@abaplint/core 2.119.33 → 2.119.34

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.
@@ -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)(sqlFields, whereClause, groupHaving, trailingOpts, (0, combi_1.optPrio)(intoSingle), (0, combi_1.optPrio)(_1.DatabaseConnection)), (0, combi_1.seq)(intoSingle, byp, whereClause, groupHaving, trailingOpts), (0, combi_1.seq)(whereClause, groupHaving, trailingOpts, (0, combi_1.optPrio)(intoSingle), (0, combi_1.optPrio)(_1.DatabaseConnection))));
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.altPrio)((0, combi_1.seq)(sqlFields, fae, whereClause, groupHaving, ...orderUpOff, trailingOpts), (0, combi_1.seq)(fae, whereClause, groupHaving, ...orderUpOff, trailingOpts)));
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), (0, combi_1.optPrio)(_1.SQLOptions))), (0, combi_1.optPrio)((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)(sqlFields, fae, whereClause, groupHaving, ...orderUpOff, trailingOpts, trailingInto), (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)(fae, whereClause, groupHaving, ...orderUpOff, trailingOpts, trailingInto)));
54
- const selectTableIntoThenFrom = (0, combi_1.seq)(intoForPackSize, (0, combi_1.optPrio)(_1.SQLPackageSize), (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(_1.DatabaseConnection), afterFromWithInto);
55
- const selectOtherIntoThenFrom = (0, combi_1.seq)(intoSingle, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(_1.DatabaseConnection), afterFromWithInto);
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,6 +6,7 @@ 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);
@@ -18,7 +19,9 @@ class SQLCompare extends combi_1.Expression {
18
19
  const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
19
20
  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
21
  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);
22
+ // simple subquery for pre-v750 versions: EXISTS ( SELECT ... )
23
+ const simpleSubSelect = (0, combi_1.seq)("(", "SELECT", (0, _select_core_1.buildSelectCore)(undefined, false), ")");
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 type = (_d = this.input.scope.getDDIC().lookupDDLS(name)) === null || _d === void 0 ? void 0 : _d.type;
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(name)) {
493
- return new Types.UnknownType(`DDLS ${name} not found`);
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 isRap = node.findExpressionAfterToken("IMPORTING");
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 ")
@@ -74,7 +74,7 @@ class Registry {
74
74
  }
75
75
  static abaplintVersion() {
76
76
  // magic, see build script "version.js"
77
- return "2.119.33";
77
+ return "2.119.34";
78
78
  }
79
79
  getDDICReferences() {
80
80
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.119.33",
3
+ "version": "2.119.34",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",