@abaplint/core 2.113.40 → 2.113.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/abaplint.d.ts +5 -0
- package/build/src/abap/2_statements/expressions/field_sub.js +1 -1
- package/build/src/abap/2_statements/expressions/index.js +1 -0
- package/build/src/abap/2_statements/expressions/select_loop.js +1 -1
- package/build/src/abap/2_statements/expressions/sql_field_list_loop.js +3 -1
- package/build/src/abap/2_statements/expressions/sql_function.js +15 -23
- package/build/src/abap/2_statements/expressions/sql_function_input.js +24 -0
- package/build/src/abap/2_statements/statements/program.js +1 -1
- package/build/src/abap/5_syntax/statements/method_implementation.js +7 -6
- package/build/src/abap/5_syntax/statements/read_table.js +1 -1
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -2334,6 +2334,7 @@ declare namespace Expressions {
|
|
|
2334
2334
|
SQLFromSource,
|
|
2335
2335
|
SQLFrom,
|
|
2336
2336
|
SQLFunction,
|
|
2337
|
+
SQLFunctionInput,
|
|
2337
2338
|
SQLGroupBy,
|
|
2338
2339
|
SQLHaving,
|
|
2339
2340
|
SQLHints,
|
|
@@ -6012,6 +6013,10 @@ declare class SQLFunction extends Expression {
|
|
|
6012
6013
|
getRunnable(): IStatementRunnable;
|
|
6013
6014
|
}
|
|
6014
6015
|
|
|
6016
|
+
declare class SQLFunctionInput extends Expression {
|
|
6017
|
+
getRunnable(): IStatementRunnable;
|
|
6018
|
+
}
|
|
6019
|
+
|
|
6015
6020
|
declare class SQLGroupBy extends Expression {
|
|
6016
6021
|
getRunnable(): IStatementRunnable;
|
|
6017
6022
|
}
|
|
@@ -6,7 +6,7 @@ const tokens_1 = require("../../1_lexer/tokens");
|
|
|
6
6
|
const table_body_1 = require("./table_body");
|
|
7
7
|
class FieldSub extends combi_1.Expression {
|
|
8
8
|
getRunnable() {
|
|
9
|
-
const ret = (0, combi_1.seq)((0, combi_1.regex)(/^\*?!?(\/\w+\/)?[a-zA-Z_
|
|
9
|
+
const ret = (0, combi_1.seq)((0, combi_1.regex)(/^\*?!?(\/\w+\/)?[a-zA-Z_%$\?][\w%$\$\*]*$/), (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.regex)(/^[\w%$\$\*]+$/))), (0, combi_1.opt)(table_body_1.TableBody));
|
|
10
10
|
return ret;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -189,6 +189,7 @@ __exportStar(require("./sql_for_all_entries"), exports);
|
|
|
189
189
|
__exportStar(require("./sql_from_source"), exports);
|
|
190
190
|
__exportStar(require("./sql_from"), exports);
|
|
191
191
|
__exportStar(require("./sql_function"), exports);
|
|
192
|
+
__exportStar(require("./sql_function_input"), exports);
|
|
192
193
|
__exportStar(require("./sql_group_by"), exports);
|
|
193
194
|
__exportStar(require("./sql_having"), exports);
|
|
194
195
|
__exportStar(require("./sql_hints"), exports);
|
|
@@ -20,7 +20,7 @@ class SelectLoop extends combi_1.Expression {
|
|
|
20
20
|
const packTab = (0, combi_1.seq)(pack, _1.SQLIntoTable);
|
|
21
21
|
const into = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
|
|
22
22
|
const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, (0, combi_1.alt)(tab, into, packTab));
|
|
23
|
-
const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields), (0, combi_1.optPrio)((0, combi_1.seq)(where, (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), into, sql_up_to_1.SQLUpTo)));
|
|
23
|
+
const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields), (0, combi_1.optPrio)((0, combi_1.seq)(where, (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo))));
|
|
24
24
|
const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
|
|
25
25
|
return ret;
|
|
26
26
|
}
|
|
@@ -5,13 +5,15 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
7
|
const sql_path_1 = require("./sql_path");
|
|
8
|
+
const tokens_1 = require("../../1_lexer/tokens");
|
|
8
9
|
// loop must include one field from the database table
|
|
9
10
|
class SQLFieldListLoop extends combi_1.Expression {
|
|
10
11
|
getRunnable() {
|
|
11
12
|
const comma = (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp05, ","));
|
|
12
13
|
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
13
14
|
const someField = (0, combi_1.seq)(_1.SQLField, comma);
|
|
14
|
-
const
|
|
15
|
+
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain));
|
|
16
|
+
const fieldList = (0, combi_1.seq)((0, combi_1.star)(someField), (0, combi_1.alt)(_1.SQLFieldName, abap, sql_path_1.SQLPath, _1.Constant), (0, combi_1.optPrio)(as), comma, (0, combi_1.star)(someField));
|
|
15
17
|
const fields = (0, combi_1.alt)("*", _1.Dynamic, fieldList);
|
|
16
18
|
return fields;
|
|
17
19
|
}
|
|
@@ -1,37 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SQLFunction = void 0;
|
|
4
|
-
const constant_1 = require("./constant");
|
|
5
4
|
const version_1 = require("../../../version");
|
|
6
5
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
7
6
|
const combi_1 = require("../combi");
|
|
8
7
|
const integer_1 = require("./integer");
|
|
9
|
-
const
|
|
10
|
-
const sql_field_name_1 = require("./sql_field_name");
|
|
11
|
-
const simple_source3_1 = require("./simple_source3");
|
|
12
|
-
const source_1 = require("./source");
|
|
13
|
-
const sql_aggregation_1 = require("./sql_aggregation");
|
|
8
|
+
const sql_function_input_1 = require("./sql_function_input");
|
|
14
9
|
class SQLFunction extends combi_1.Expression {
|
|
15
10
|
getRunnable() {
|
|
16
|
-
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), source_1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
17
|
-
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(simple_source3_1.SimpleSource3, paren)));
|
|
18
|
-
const param = (0, combi_1.altPrio)(SQLFunction, sql_aggregation_1.SQLAggregation, sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, constant_1.Constant, at);
|
|
19
11
|
const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.seq)("DEC", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, ",", integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), "FLTP", "NUMC", "INT8");
|
|
20
|
-
const commaParam = (0, combi_1.seq)(",",
|
|
12
|
+
const commaParam = (0, combi_1.seq)(",", sql_function_input_1.SQLFunctionInput);
|
|
21
13
|
// note: the function names are not keywords, they are usually in lower case
|
|
22
|
-
const abs = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^abs$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
23
|
-
const cast = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^cast$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
24
|
-
const ceil = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^ceil$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
25
|
-
const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^coalesce$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
26
|
-
const concat = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^concat$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
27
|
-
const div = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^div$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
28
|
-
const floor = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^floor$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
29
|
-
const length = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^length$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
30
|
-
const lower = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)((0, combi_1.regex)(/^lower$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
31
|
-
const mod = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^mod$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
32
|
-
const replace = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^replace$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
33
|
-
const round = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^round$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
34
|
-
const upper = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)((0, combi_1.regex)(/^upper$/i), (0, combi_1.tok)(tokens_1.ParenLeftW),
|
|
14
|
+
const abs = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^abs$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
15
|
+
const cast = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^cast$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
16
|
+
const ceil = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^ceil$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
17
|
+
const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^coalesce$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.optPrio)(commaParam), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
18
|
+
const concat = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^concat$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
19
|
+
const div = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^div$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
20
|
+
const floor = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^floor$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
21
|
+
const length = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^length$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
22
|
+
const lower = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)((0, combi_1.regex)(/^lower$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
23
|
+
const mod = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^mod$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
24
|
+
const replace = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^replace$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
25
|
+
const round = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^round$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
26
|
+
const upper = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)((0, combi_1.regex)(/^upper$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
35
27
|
const uuid = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)((0, combi_1.regex)(/^uuid$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
36
28
|
return (0, combi_1.altPrio)(uuid, abs, ceil, floor, cast, div, mod, coalesce, concat, replace, length, lower, upper, round);
|
|
37
29
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SQLFunctionInput = void 0;
|
|
4
|
+
const constant_1 = require("./constant");
|
|
5
|
+
const version_1 = require("../../../version");
|
|
6
|
+
const tokens_1 = require("../../1_lexer/tokens");
|
|
7
|
+
const combi_1 = require("../combi");
|
|
8
|
+
const sql_alias_field_1 = require("./sql_alias_field");
|
|
9
|
+
const sql_field_name_1 = require("./sql_field_name");
|
|
10
|
+
const simple_source3_1 = require("./simple_source3");
|
|
11
|
+
const source_1 = require("./source");
|
|
12
|
+
const sql_aggregation_1 = require("./sql_aggregation");
|
|
13
|
+
const sql_function_1 = require("./sql_function");
|
|
14
|
+
class SQLFunctionInput extends combi_1.Expression {
|
|
15
|
+
getRunnable() {
|
|
16
|
+
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), source_1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
17
|
+
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(simple_source3_1.SimpleSource3, paren)));
|
|
18
|
+
const param = (0, combi_1.altPrio)(sql_function_1.SQLFunction, sql_aggregation_1.SQLAggregation, sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, constant_1.Constant, at);
|
|
19
|
+
const operator = (0, combi_1.altPrio)("+", "-", "*", "/", "&&");
|
|
20
|
+
return (0, combi_1.seq)(param, (0, combi_1.starPrio)((0, combi_1.seq)(operator, param)));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.SQLFunctionInput = SQLFunctionInput;
|
|
24
|
+
//# sourceMappingURL=sql_function_input.js.map
|
|
@@ -11,7 +11,7 @@ class Program {
|
|
|
11
11
|
const heading = (0, combi_1.str)("NO STANDARD PAGE HEADING");
|
|
12
12
|
const line = (0, combi_1.seq)("LINE-COUNT", expressions_1.Source);
|
|
13
13
|
const options = (0, combi_1.per)(message, size, heading, line);
|
|
14
|
-
const ret = (0, combi_1.seq)("PROGRAM", (0, combi_1.
|
|
14
|
+
const ret = (0, combi_1.seq)("PROGRAM", (0, combi_1.opt)(expressions_1.ReportName), (0, combi_1.opt)(options));
|
|
15
15
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -19,17 +19,18 @@ class MethodImplementation {
|
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
const { method: methodDefinition } = helper.searchMethodName(classDefinition, methodName);
|
|
22
|
-
if (methodDefinition === undefined) {
|
|
23
|
-
const message = "Method definition \"" + methodName + "\" not found";
|
|
24
|
-
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
22
|
const start = node.getFirstToken().getStart();
|
|
28
|
-
if (methodDefinition.isStatic() === false) {
|
|
23
|
+
if ((methodDefinition === null || methodDefinition === void 0 ? void 0 : methodDefinition.isStatic()) === false) {
|
|
29
24
|
input.scope.push(_scope_type_1.ScopeType.MethodInstance, methodName, start, input.filename);
|
|
30
25
|
input.scope.addList(classDefinition.getAttributes().getInstance());
|
|
31
26
|
}
|
|
32
27
|
input.scope.push(_scope_type_1.ScopeType.Method, methodName, start, input.filename);
|
|
28
|
+
// note: the scope must be pushed before returning
|
|
29
|
+
if (methodDefinition === undefined) {
|
|
30
|
+
const message = "Method definition \"" + methodName + "\" not found";
|
|
31
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
33
34
|
input.scope.addReference(methodToken, methodDefinition, _reference_1.ReferenceType.MethodImplementationReference, input.filename);
|
|
34
35
|
input.scope.addList(methodDefinition.getParameters().getAll());
|
|
35
36
|
for (const i of helper.findInterfaces(classDefinition)) {
|
|
@@ -41,7 +41,7 @@ class ReadTable {
|
|
|
41
41
|
if (indexSource) {
|
|
42
42
|
const indexType = new source_1.Source().runSyntax(indexSource, input);
|
|
43
43
|
if (new _type_utils_1.TypeUtils(input.scope).isAssignable(indexType, basic_1.IntegerType.get()) === false) {
|
|
44
|
-
const message = "READ TABLE, INDEX must be simple";
|
|
44
|
+
const message = "READ TABLE, INDEX must be simple, got " + (indexType === null || indexType === void 0 ? void 0 : indexType.constructor.name);
|
|
45
45
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
46
46
|
return;
|
|
47
47
|
}
|
package/build/src/registry.js
CHANGED