@abaplint/core 2.119.33 → 2.119.35
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/src/abap/2_statements/expressions/_select_core.js +7 -7
- package/build/src/abap/2_statements/expressions/sql_compare.js +5 -2
- package/build/src/abap/5_syntax/basic_types.js +13 -3
- package/build/src/abap/types/method_parameters.js +3 -2
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ function buildSelectSingleCore(allowInto = false) {
|
|
|
23
23
|
const singleBody = (0, combi_1.seq)(_1.SQLFrom, client, byp, whereClause, groupHaving, trailingOpts);
|
|
24
24
|
return (0, combi_1.seq)(fieldList, singleBody);
|
|
25
25
|
}
|
|
26
|
-
const singleAfterFrom = (0, combi_1.seq)(_1.SQLFrom, client, byp, (0, combi_1.optPrio)(_1.DatabaseConnection), (0, combi_1.altPrio)((0, combi_1.seq)(
|
|
26
|
+
const singleAfterFrom = (0, combi_1.seq)(_1.SQLFrom, client, byp, (0, combi_1.optPrio)(_1.DatabaseConnection), (0, combi_1.altPrio)((0, combi_1.seq)(intoSingle, byp, whereClause, groupHaving, trailingOpts), (0, combi_1.seq)((0, combi_1.optPrio)(sqlFields), whereClause, groupHaving, trailingOpts, (0, combi_1.optPrio)(intoSingle), (0, combi_1.optPrio)(_1.DatabaseConnection))));
|
|
27
27
|
const singleIntoBeforeFrom = (0, combi_1.seq)(intoSingle, _1.SQLFrom, client, byp, (0, combi_1.optPrio)(_1.DatabaseConnection), whereClause, groupHaving, trailingOpts);
|
|
28
28
|
return (0, combi_1.seq)(fieldList, byp, (0, combi_1.altPrio)(singleIntoBeforeFrom, singleAfterFrom));
|
|
29
29
|
}
|
|
@@ -45,15 +45,15 @@ function buildSelectCore(allowInto = false, allowOrderBy = true) {
|
|
|
45
45
|
const intoSingle = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
|
|
46
46
|
const intoForPackSize = _1.SQLIntoTable;
|
|
47
47
|
if (!allowInto) {
|
|
48
|
-
const afterFromNoInto = (0, combi_1.seq)(_1.SQLFrom, client, byp, (0, combi_1.
|
|
48
|
+
const afterFromNoInto = (0, combi_1.seq)(_1.SQLFrom, client, byp, (0, combi_1.seq)((0, combi_1.optPrio)(sqlFields), fae, whereClause, groupHaving, ...orderUpOff, trailingOpts));
|
|
49
49
|
return (0, combi_1.altPrio)((0, combi_1.seq)("SINGLE", buildSelectSingleCore(false)), (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), fieldList, byp, afterFromNoInto));
|
|
50
50
|
}
|
|
51
51
|
const fromPackSize = (0, combi_1.seq)((0, combi_1.optPrio)(_1.SQLPackageSize), (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(_1.DatabaseConnection), (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo));
|
|
52
|
-
const trailingInto = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.seq)(intoForPackSize, (0, combi_1.optPrio)(_1.SQLPackageSize), byp, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(offset), (0, combi_1.optPrio)(_1.SQLOrderBy)
|
|
53
|
-
const afterFromWithInto = (0, combi_1.seq)((0, combi_1.optPrio)(_1.SQLFrom), client, byp, fromPackSize, (0, combi_1.altPrio)((0, combi_1.seq)(
|
|
54
|
-
const selectTableIntoThenFrom = (0, combi_1.seq)(intoForPackSize, (0, combi_1.optPrio)(_1.SQLPackageSize)
|
|
55
|
-
const selectOtherIntoThenFrom =
|
|
56
|
-
const nonSingleBody = (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), fieldList, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.altPrio)(selectTableIntoThenFrom, selectOtherIntoThenFrom, afterFromWithInto)
|
|
52
|
+
const trailingInto = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)(intoForPackSize, (0, combi_1.optPrio)(_1.SQLPackageSize), byp, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(offset), (0, combi_1.optPrio)(_1.SQLOrderBy)), (0, combi_1.seq)(intoSingle, byp, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(offset)))), (0, combi_1.optPrio)(_1.SQLOptions));
|
|
53
|
+
const afterFromWithInto = (0, combi_1.seq)((0, combi_1.optPrio)(_1.SQLFrom), client, byp, fromPackSize, (0, combi_1.altPrio)((0, combi_1.seq)(intoForPackSize, (0, combi_1.optPrio)(_1.SQLPackageSize), byp, (0, combi_1.optPrio)(_1.DatabaseConnection), (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(offset), fae, whereClause, groupHaving, ...orderUpOff, trailingOpts), (0, combi_1.seq)(intoSingle, byp, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, fae, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(offset), whereClause, groupHaving, ...orderUpOff, trailingOpts), (0, combi_1.seq)((0, combi_1.optPrio)(sqlFields), fae, whereClause, groupHaving, ...orderUpOff, trailingOpts, trailingInto)));
|
|
54
|
+
const selectTableIntoThenFrom = (0, combi_1.seq)(intoForPackSize, (0, combi_1.optPrio)(_1.SQLPackageSize));
|
|
55
|
+
const selectOtherIntoThenFrom = intoSingle;
|
|
56
|
+
const nonSingleBody = (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), fieldList, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)((0, combi_1.altPrio)(selectTableIntoThenFrom, selectOtherIntoThenFrom)), (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(_1.DatabaseConnection), afterFromWithInto);
|
|
57
57
|
return (0, combi_1.altPrio)((0, combi_1.seq)("SINGLE", buildSelectSingleCore(true)), nonSingleBody);
|
|
58
58
|
}
|
|
59
59
|
//# sourceMappingURL=_select_core.js.map
|
|
@@ -6,19 +6,22 @@ const _1 = require(".");
|
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
7
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
8
8
|
const sql_set_op_group_1 = require("./sql_set_op_group");
|
|
9
|
+
const _select_core_1 = require("./_select_core");
|
|
9
10
|
class SQLCompare extends combi_1.Expression {
|
|
10
11
|
getRunnable() {
|
|
11
12
|
const subSelect = (0, combi_1.ver)(version_1.Version.v750, sql_set_op_group_1.SQLSetOpGroup, version_1.Version.OpenABAP);
|
|
13
|
+
const simpleSubSelect = (0, combi_1.seq)("(", "SELECT", (0, _select_core_1.buildSelectCore)(undefined, false), ")");
|
|
14
|
+
const simpleScalarSubSelect = (0, combi_1.ver)(version_1.Version.v740sp08, simpleSubSelect, version_1.Version.OpenABAP);
|
|
12
15
|
const between = (0, combi_1.seq)("BETWEEN", _1.SQLSource, "AND", _1.SQLSource);
|
|
13
16
|
const like = (0, combi_1.seq)("LIKE", _1.SQLSource, (0, combi_1.optPrio)((0, combi_1.seq)("ESCAPE", _1.SQLSource)));
|
|
14
17
|
const nul = (0, combi_1.seq)("IS", (0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)("NULL", (0, combi_1.ver)(version_1.Version.v753, "INITIAL")));
|
|
15
|
-
const sub = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("ALL", "ANY", "SOME")), subSelect);
|
|
18
|
+
const sub = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("ALL", "ANY", "SOME")), (0, combi_1.altPrio)(subSelect, simpleScalarSubSelect));
|
|
16
19
|
const source = new _1.SQLSource();
|
|
17
20
|
const arith = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/"), _1.SQLFieldName)), version_1.Version.OpenABAP);
|
|
18
21
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
19
22
|
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)(_1.SimpleSource3, paren)), version_1.Version.OpenABAP);
|
|
20
23
|
const rett = (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLCase, _1.SQLAggregation, _1.SQLFunction, _1.ConstantString, (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLPath, _1.SQLFieldName), (0, combi_1.optPrio)(arith)), at), (0, combi_1.altPrio)((0, combi_1.seq)(_1.SQLCompareOperator, (0, combi_1.altPrio)(sub, _1.SQLCase, _1.SQLAggregation, _1.SQLFunction, (0, combi_1.seq)(source, (0, combi_1.optPrio)(arith)))), (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)(_1.SQLIn, like, between)), nul));
|
|
21
|
-
const exists = (0, combi_1.seq)("EXISTS", subSelect);
|
|
24
|
+
const exists = (0, combi_1.seq)("EXISTS", (0, combi_1.altPrio)(subSelect, simpleSubSelect));
|
|
22
25
|
return (0, combi_1.altPrio)(exists, _1.Dynamic, rett);
|
|
23
26
|
}
|
|
24
27
|
}
|
|
@@ -485,12 +485,13 @@ class BasicTypes {
|
|
|
485
485
|
|| text.startsWith("TYPE TABLE FOR DELETE ")
|
|
486
486
|
|| text.startsWith("TYPE TABLE FOR UPDATE "))) {
|
|
487
487
|
const name = typename.concatTokens();
|
|
488
|
-
const
|
|
488
|
+
const ddlsName = this.getRAPBaseEntityName(name);
|
|
489
|
+
const type = (_d = this.input.scope.getDDIC().lookupDDLS(ddlsName)) === null || _d === void 0 ? void 0 : _d.type;
|
|
489
490
|
if (type) {
|
|
490
491
|
return new Types.TableType(basic_1.VoidType.get("RAP-TODO"), options);
|
|
491
492
|
}
|
|
492
|
-
else if (this.input.scope.getDDIC().inErrorNamespace(
|
|
493
|
-
return new Types.UnknownType(`DDLS ${
|
|
493
|
+
else if (this.input.scope.getDDIC().inErrorNamespace(ddlsName)) {
|
|
494
|
+
return new Types.UnknownType(`DDLS ${ddlsName} not found`);
|
|
494
495
|
}
|
|
495
496
|
else {
|
|
496
497
|
return Types.VoidType.get(name);
|
|
@@ -662,6 +663,15 @@ class BasicTypes {
|
|
|
662
663
|
}
|
|
663
664
|
return false;
|
|
664
665
|
}
|
|
666
|
+
getRAPBaseEntityName(name) {
|
|
667
|
+
const association = name.indexOf("\\_");
|
|
668
|
+
const path = name.indexOf("\\\\");
|
|
669
|
+
if (association === -1 && path === -1) {
|
|
670
|
+
return name;
|
|
671
|
+
}
|
|
672
|
+
const splitAt = association === -1 ? path : path === -1 ? association : Math.min(association, path);
|
|
673
|
+
return name.substring(0, splitAt);
|
|
674
|
+
}
|
|
665
675
|
// todo, rewrite this method
|
|
666
676
|
resolveTypeChain(expr) {
|
|
667
677
|
var _a, _b, _c, _d;
|
|
@@ -220,7 +220,9 @@ class MethodParameters {
|
|
|
220
220
|
}
|
|
221
221
|
workaroundRAP(node, input, parentName) {
|
|
222
222
|
const resultName = node.findExpressionAfterToken("RESULT");
|
|
223
|
-
const
|
|
223
|
+
const concat = node.concatTokens().toUpperCase();
|
|
224
|
+
const isRap = node.findExpressionAfterToken("IMPORTING")
|
|
225
|
+
|| (concat.includes(" IMPORTING REQUEST ") ? node.findExpressionAfterToken("REQUEST") : undefined);
|
|
224
226
|
if (isRap) {
|
|
225
227
|
for (const foo of node.findDirectExpressions(Expressions.MethodParamName)) {
|
|
226
228
|
if (foo === resultName) {
|
|
@@ -228,7 +230,6 @@ class MethodParameters {
|
|
|
228
230
|
}
|
|
229
231
|
this.importing.push(new _typed_identifier_1.TypedIdentifier(foo.getFirstToken(), input.filename, basic_1.VoidType.get("RapMethodParameter"), ["importing" /* IdentifierMeta.MethodImporting */]));
|
|
230
232
|
}
|
|
231
|
-
const concat = node.concatTokens().toUpperCase();
|
|
232
233
|
if (concat.includes(" FOR VALIDATE ")
|
|
233
234
|
|| concat.includes(" FOR BEHAVIOR ")
|
|
234
235
|
|| concat.includes(" FOR DETERMINE ")
|
package/build/src/registry.js
CHANGED