@abaplint/core 2.113.40 → 2.113.41
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/index.js +1 -0
- 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/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
|
}
|
|
@@ -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);
|
|
@@ -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
|
|
@@ -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