@abaplint/core 2.119.32 → 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.
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dynComp = dynComp;
4
+ exports.dynAttr = dynAttr;
5
+ const combi_1 = require("../combi");
6
+ const tokens_1 = require("../../1_lexer/tokens");
7
+ const constant_1 = require("./constant");
8
+ const field_chain_1 = require("./field_chain");
9
+ const version_1 = require("../../../version");
10
+ const dynIdent = (0, combi_1.tok)(tokens_1.ParenLeft);
11
+ const dynClose = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRight), (0, combi_1.tok)(tokens_1.ParenRightW));
12
+ const dynInside = (0, combi_1.altPrio)(new field_chain_1.FieldChain(), constant_1.Constant);
13
+ function dynComp(...inside) {
14
+ return (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), dynIdent, dynInside, ...inside, dynClose));
15
+ }
16
+ function dynAttr() {
17
+ return (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.InstanceArrow), dynIdent, dynInside, dynClose));
18
+ }
19
+ //# sourceMappingURL=_dynamic_access.js.map
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildSelectSingleCore = buildSelectSingleCore;
3
4
  exports.buildSelectCore = buildSelectCore;
4
5
  const combi_1 = require("../combi");
5
6
  const _1 = require(".");
@@ -7,7 +8,26 @@ const version_1 = require("../../../version");
7
8
  const sql_group_by_1 = require("./sql_group_by");
8
9
  const sql_into_structure_1 = require("./sql_into_structure");
9
10
  const sql_up_to_1 = require("./sql_up_to");
10
- function buildSelectCore(into, allowOrderBy = true) {
11
+ function buildSelectSingleCore(allowInto = false) {
12
+ const where = (0, combi_1.seq)("WHERE", _1.SQLCond);
13
+ const sqlFields = (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields, version_1.Version.OpenABAP);
14
+ const privileged = (0, combi_1.ver)(version_1.Version.v758, _1.SQLPrivilegedAccess);
15
+ const fieldList = (0, combi_1.optPrio)(_1.SQLFieldList);
16
+ const client = (0, combi_1.optPrio)(_1.SQLClient);
17
+ const byp = (0, combi_1.optPrio)(_1.SQLBypassingBuffer);
18
+ const whereClause = (0, combi_1.optPrio)(where);
19
+ const groupHaving = (0, combi_1.seq)((0, combi_1.optPrio)(sql_group_by_1.SQLGroupBy), (0, combi_1.optPrio)(_1.SQLHaving));
20
+ const trailingOpts = (0, combi_1.seq)((0, combi_1.optPrio)(_1.DatabaseConnection), (0, combi_1.optPrio)(_1.SQLHints), (0, combi_1.optPrio)(privileged), (0, combi_1.optPrio)(_1.SQLOptions));
21
+ const intoSingle = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
22
+ if (!allowInto) {
23
+ const singleBody = (0, combi_1.seq)(_1.SQLFrom, client, byp, whereClause, groupHaving, trailingOpts);
24
+ return (0, combi_1.seq)(fieldList, singleBody);
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)(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
+ const singleIntoBeforeFrom = (0, combi_1.seq)(intoSingle, _1.SQLFrom, client, byp, (0, combi_1.optPrio)(_1.DatabaseConnection), whereClause, groupHaving, trailingOpts);
28
+ return (0, combi_1.seq)(fieldList, byp, (0, combi_1.altPrio)(singleIntoBeforeFrom, singleAfterFrom));
29
+ }
30
+ function buildSelectCore(allowInto = false, allowOrderBy = true) {
11
31
  const where = (0, combi_1.seq)("WHERE", _1.SQLCond);
12
32
  const offset = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("OFFSET", _1.SQLSource));
13
33
  const sqlFields = (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields, version_1.Version.OpenABAP);
@@ -23,21 +43,17 @@ function buildSelectCore(into, allowOrderBy = true) {
23
43
  : [];
24
44
  const trailingOpts = (0, combi_1.seq)((0, combi_1.optPrio)(_1.DatabaseConnection), (0, combi_1.optPrio)(_1.SQLHints), (0, combi_1.optPrio)(privileged), (0, combi_1.optPrio)(_1.SQLOptions));
25
45
  const intoSingle = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
26
- const intoAny = into ? (0, combi_1.altPrio)(into, intoSingle) : intoSingle;
27
46
  const intoForPackSize = _1.SQLIntoTable;
28
- if (!into) {
29
- 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)));
30
- const singleBody = (0, combi_1.seq)(_1.SQLFrom, client, byp, whereClause, groupHaving, trailingOpts);
31
- return (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)("SINGLE", (0, combi_1.optPrio)("FOR UPDATE"), fieldList, singleBody), (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), fieldList, byp, afterFromNoInto)));
47
+ if (!allowInto) {
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
+ return (0, combi_1.altPrio)((0, combi_1.seq)("SINGLE", buildSelectSingleCore(false)), (0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), fieldList, byp, afterFromNoInto));
32
50
  }
33
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));
34
- 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))));
35
- 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.optPrio)(_1.SQLOptions)), (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.optPrio)(_1.SQLOptions)), (0, combi_1.seq)(fae, whereClause, groupHaving, ...orderUpOff, trailingOpts, trailingInto)));
36
- 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);
37
- const selectOtherIntoThenFrom = (0, combi_1.seq)(intoAny, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (0, combi_1.optPrio)(_1.DatabaseConnection), afterFromWithInto);
38
- 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));
39
- 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))));
40
- const singleIntoBeforeFrom = (0, combi_1.seq)(intoSingle, _1.SQLFrom, client, byp, (0, combi_1.optPrio)(_1.DatabaseConnection), whereClause, groupHaving, trailingOpts);
41
- return (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)("SINGLE", (0, combi_1.optPrio)("FOR UPDATE"), fieldList, byp, (0, combi_1.altPrio)(singleIntoBeforeFrom, singleAfterFrom)), nonSingleBody));
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
+ return (0, combi_1.altPrio)((0, combi_1.seq)("SINGLE", buildSelectSingleCore(true)), nonSingleBody);
42
58
  }
43
59
  //# sourceMappingURL=_select_core.js.map
@@ -4,11 +4,12 @@ exports.FieldChain = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
6
  const tokens_1 = require("../../1_lexer/tokens");
7
+ const _dynamic_access_1 = require("./_dynamic_access");
7
8
  class FieldChain extends combi_1.Expression {
8
9
  getRunnable() {
9
10
  const attr = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.InstanceArrow), _1.AttributeName);
10
11
  const comp = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)(_1.ComponentName));
11
- const chain = (0, combi_1.star)((0, combi_1.altPrio)(_1.Dereference, attr, comp, _1.TableExpression));
12
+ const chain = (0, combi_1.star)((0, combi_1.altPrio)(_1.Dereference, (0, _dynamic_access_1.dynAttr)(), attr, (0, _dynamic_access_1.dynComp)((0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength)), comp, _1.TableExpression));
12
13
  const clas = (0, combi_1.seq)(_1.ClassName, (0, combi_1.tok)(tokens_1.StaticArrow), _1.AttributeName);
13
14
  const start = (0, combi_1.altPrio)(clas, _1.SourceField, _1.SourceFieldSymbol);
14
15
  const after = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.DashW), (0, combi_1.seq)((0, combi_1.optPrio)(_1.TableBody), (0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength)));
@@ -9,10 +9,10 @@ const _select_core_1 = require("./_select_core");
9
9
  class Select extends combi_1.Expression {
10
10
  getRunnable() {
11
11
  const into = (0, combi_1.altPrio)(_1.SQLIntoTable, sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
12
- const standalone = (0, _select_core_1.buildSelectCore)(into);
12
+ const standalone = (0, combi_1.altPrio)((0, combi_1.seq)("SINGLE", (0, combi_1.optPrio)("FOR UPDATE"), (0, _select_core_1.buildSelectSingleCore)(true)), (0, _select_core_1.buildSelectCore)(true));
13
13
  const unionTail = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.plusPrio)(_1.SQLSetOp), version_1.Version.OpenABAP);
14
- const chained = (0, combi_1.seq)((0, _select_core_1.buildSelectCore)(undefined, false), unionTail, (0, combi_1.optPrio)(_1.SQLOrderBy), (0, combi_1.optPrio)(into));
15
- return (0, combi_1.altPrio)(chained, standalone);
14
+ const chained = (0, combi_1.seq)((0, _select_core_1.buildSelectCore)(false, false), unionTail, (0, combi_1.optPrio)(_1.SQLOrderBy), (0, combi_1.optPrio)(into));
15
+ return (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)(chained, standalone));
16
16
  }
17
17
  }
18
18
  exports.Select = Select;
@@ -8,6 +8,7 @@ const version_1 = require("../../../version");
8
8
  const text_element_1 = require("./text_element");
9
9
  const attribute_chain_1 = require("./attribute_chain");
10
10
  const dereference_1 = require("./dereference");
11
+ const _dynamic_access_1 = require("./_dynamic_access");
11
12
  // todo, COND and SWITCH are quite similar?
12
13
  // this class is used quite often, so its nice to have the differentiating tokens part of it
13
14
  class Source extends combi_1.Expression {
@@ -15,7 +16,8 @@ class Source extends combi_1.Expression {
15
16
  const comp = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), _1.ComponentChain);
16
17
  const attr = (0, combi_1.seq)(_1.Arrow, attribute_chain_1.AttributeChain);
17
18
  const deref = (0, combi_1.optPrio)((0, combi_1.ver)(version_1.Version.v756, dereference_1.Dereference));
18
- const method = (0, combi_1.seq)(_1.MethodCallChain, (0, combi_1.optPrio)((0, combi_1.altPrio)(attr, comp)), deref);
19
+ const dynChain = (0, combi_1.star)((0, combi_1.altPrio)((0, _dynamic_access_1.dynAttr)(), (0, _dynamic_access_1.dynComp)(), dereference_1.Dereference));
20
+ const method = (0, combi_1.seq)(_1.MethodCallChain, (0, combi_1.optPrio)((0, combi_1.altPrio)(attr, comp)), deref, dynChain);
19
21
  const rparen = (0, combi_1.tok)(tokens_1.WParenRightW);
20
22
  const rparenNoSpace = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.WParenRightW));
21
23
  const lparenNoSpace = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.ParenLeftW));
@@ -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
  }
@@ -17,7 +17,7 @@ class SQLIn extends combi_1.Expression {
17
17
  const listNeww = (0, combi_1.ver)(version_1.Version.v740sp02, listNew, version_1.Version.OpenABAP);
18
18
  const subSelect = sql_set_op_group_1.SQLSetOpGroup;
19
19
  // simple subquery for pre-v750 versions: IN ( SELECT ... ), https://github.com/abaplint/abaplint/issues/3999
20
- const simpleSubSelect = (0, combi_1.seq)("(", (0, _select_core_1.buildSelectCore)(undefined, false), ")");
20
+ const simpleSubSelect = (0, combi_1.seq)("(", "SELECT", (0, _select_core_1.buildSelectCore)(undefined, false), ")");
21
21
  const inn = (0, combi_1.seq)("IN", (0, combi_1.altPrio)(subSelect, simpleSubSelect, listOld, listNeww, _1.SQLSource));
22
22
  return inn;
23
23
  }
@@ -7,7 +7,7 @@ const sql_set_op_group_1 = require("./sql_set_op_group");
7
7
  const _select_core_1 = require("./_select_core");
8
8
  class SQLSetOp extends combi_1.Expression {
9
9
  getRunnable() {
10
- const operand = (0, combi_1.altPrio)(sql_set_op_group_1.SQLSetOpGroup, (0, _select_core_1.buildSelectCore)(undefined, false));
10
+ const operand = (0, combi_1.altPrio)(sql_set_op_group_1.SQLSetOpGroup, (0, combi_1.seq)("SELECT", (0, _select_core_1.buildSelectCore)(false, false)));
11
11
  const union = (0, combi_1.seq)("UNION", (0, combi_1.optPrio)((0, combi_1.altPrio)("DISTINCT", "ALL")));
12
12
  const intersectExcept = (0, combi_1.altPrio)((0, combi_1.seq)("INTERSECT", (0, combi_1.optPrio)("DISTINCT")), (0, combi_1.seq)("EXCEPT", (0, combi_1.optPrio)("DISTINCT")));
13
13
  const op = (0, combi_1.altPrio)((0, combi_1.ver)(version_1.Version.v750, union, version_1.Version.OpenABAP), (0, combi_1.ver)(version_1.Version.v756, intersectExcept));
@@ -7,7 +7,7 @@ const version_1 = require("../../../version");
7
7
  const _select_core_1 = require("./_select_core");
8
8
  class SQLSetOpGroup extends combi_1.Expression {
9
9
  getRunnable() {
10
- const operand = (0, combi_1.altPrio)(SQLSetOpGroup, (0, _select_core_1.buildSelectCore)(undefined, false));
10
+ const operand = (0, combi_1.altPrio)(SQLSetOpGroup, (0, combi_1.seq)("SELECT", (0, _select_core_1.buildSelectCore)(false, false)));
11
11
  const chain = (0, combi_1.seq)(operand, (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.ver)(version_1.Version.v750, (0, combi_1.plusPrio)(_1.SQLSetOp), version_1.Version.OpenABAP), (0, combi_1.optPrio)(_1.SQLOrderBy))));
12
12
  return (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("(", chain, ")"), version_1.Version.OpenABAP);
13
13
  }
@@ -6,11 +6,12 @@ const _1 = require(".");
6
6
  const tokens_1 = require("../../1_lexer/tokens");
7
7
  const attribute_name_1 = require("./attribute_name");
8
8
  const dereference_1 = require("./dereference");
9
+ const _dynamic_access_1 = require("./_dynamic_access");
9
10
  class Target extends combi_1.Expression {
10
11
  getRunnable() {
11
12
  const attr = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.InstanceArrow), attribute_name_1.AttributeName);
12
13
  const comp = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), _1.ComponentName);
13
- const something = (0, combi_1.starPrio)((0, combi_1.altPrio)(dereference_1.Dereference, attr, comp, _1.TableExpression));
14
+ const something = (0, combi_1.starPrio)((0, combi_1.altPrio)(dereference_1.Dereference, (0, _dynamic_access_1.dynAttr)(), attr, (0, _dynamic_access_1.dynComp)(), comp, _1.TableExpression));
14
15
  const clas = (0, combi_1.seq)(_1.ClassName, (0, combi_1.tok)(tokens_1.StaticArrow), attribute_name_1.AttributeName);
15
16
  const start = (0, combi_1.altPrio)(_1.Cast, _1.NewObject, clas, _1.TargetField, _1.TargetFieldSymbol);
16
17
  const fields = (0, combi_1.seq)((0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength));
@@ -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;
@@ -37,9 +37,15 @@ exports.SQLIn = void 0;
37
37
  const Expressions = __importStar(require("../../2_statements/expressions"));
38
38
  const basic_1 = require("../../types/basic");
39
39
  const _syntax_input_1 = require("../_syntax_input");
40
+ const sql_set_op_group_1 = require("./sql_set_op_group");
40
41
  const sql_source_1 = require("./sql_source");
41
42
  class SQLIn {
42
43
  static runSyntax(node, input) {
44
+ const setop = node.findDirectExpression(Expressions.SQLSetOpGroup);
45
+ if (setop) {
46
+ sql_set_op_group_1.SQLSetOpGroup.runSyntax(setop, input);
47
+ return;
48
+ }
43
49
  if (node.getChildren().length === 2) {
44
50
  const insource = node.findFirstExpression(Expressions.SQLSource);
45
51
  if (insource) {
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.SQLSetOpGroup = void 0;
37
+ const Expressions = __importStar(require("../../2_statements/expressions"));
38
+ const select_1 = require("./select");
39
+ class SQLSetOpGroup {
40
+ static runSyntax(node, input) {
41
+ if (node.findDirectExpression(Expressions.SQLFrom)) {
42
+ select_1.Select.runSyntax(node, input, true);
43
+ }
44
+ for (const group of node.findDirectExpressions(Expressions.SQLSetOpGroup)) {
45
+ SQLSetOpGroup.runSyntax(group, input);
46
+ }
47
+ for (const setop of node.findDirectExpressions(Expressions.SQLSetOp)) {
48
+ SQLSetOpGroup.runSyntax(setop, input);
49
+ }
50
+ }
51
+ }
52
+ exports.SQLSetOpGroup = SQLSetOpGroup;
53
+ //# sourceMappingURL=sql_set_op_group.js.map
@@ -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.32";
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.32",
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",