@abaplint/core 2.119.31 → 2.119.33

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.
Files changed (24) hide show
  1. package/build/abaplint.d.ts +5 -0
  2. package/build/src/abap/2_statements/expressions/_dynamic_access.js +19 -0
  3. package/build/src/abap/2_statements/expressions/_select_core.js +29 -13
  4. package/build/src/abap/2_statements/expressions/field_chain.js +2 -1
  5. package/build/src/abap/2_statements/expressions/field_length.js +1 -1
  6. package/build/src/abap/2_statements/expressions/index.js +1 -0
  7. package/build/src/abap/2_statements/expressions/select.js +3 -3
  8. package/build/src/abap/2_statements/expressions/source.js +3 -1
  9. package/build/src/abap/2_statements/expressions/sql_case.js +5 -4
  10. package/build/src/abap/2_statements/expressions/sql_client.js +4 -1
  11. package/build/src/abap/2_statements/expressions/sql_field.js +2 -4
  12. package/build/src/abap/2_statements/expressions/sql_group_by.js +8 -4
  13. package/build/src/abap/2_statements/expressions/sql_hints.js +2 -2
  14. package/build/src/abap/2_statements/expressions/sql_in.js +4 -1
  15. package/build/src/abap/2_statements/expressions/sql_join.js +3 -2
  16. package/build/src/abap/2_statements/expressions/sql_join_source.js +15 -0
  17. package/build/src/abap/2_statements/expressions/sql_set_op.js +1 -1
  18. package/build/src/abap/2_statements/expressions/sql_set_op_group.js +1 -1
  19. package/build/src/abap/2_statements/expressions/target.js +2 -1
  20. package/build/src/abap/5_syntax/expressions/sql_in.js +6 -0
  21. package/build/src/abap/5_syntax/expressions/sql_set_op_group.js +53 -0
  22. package/build/src/abap/types/method_parameters.js +2 -0
  23. package/build/src/registry.js +1 -1
  24. package/package.json +3 -3
@@ -2593,6 +2593,7 @@ declare namespace Expressions {
2593
2593
  SQLFieldListLoopGreedy,
2594
2594
  SQLIntoTable,
2595
2595
  SQLJoin,
2596
+ SQLJoinSource,
2596
2597
  SQLOptions,
2597
2598
  SQLPackageSize,
2598
2599
  SQLOrderBy,
@@ -6485,6 +6486,10 @@ declare class SQLJoin extends Expression {
6485
6486
  getRunnable(): IStatementRunnable;
6486
6487
  }
6487
6488
 
6489
+ declare class SQLJoinSource extends Expression {
6490
+ getRunnable(): IStatementRunnable;
6491
+ }
6492
+
6488
6493
  declare class SQLOptions extends Expression {
6489
6494
  getRunnable(): IStatementRunnable;
6490
6495
  }
@@ -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)(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))));
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) {
47
+ if (!allowInto) {
29
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)));
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)));
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
- 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));
34
- const trailingInto = (0, combi_1.seq)((0, combi_1.optPrio)((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.SQLOrderBy), (0, combi_1.optPrio)(_1.SQLOptions))), (0, combi_1.optPrio)((0, combi_1.seq)(intoSingle, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, (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), (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, fae, whereClause, groupHaving, ...orderUpOff, trailingOpts, (0, combi_1.optPrio)(_1.SQLOptions)), (0, combi_1.seq)(intoSingle, byp, fae, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, 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), afterFromWithInto);
37
- const selectOtherIntoThenFrom = (0, combi_1.seq)(intoAny, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), byp, afterFromWithInto);
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);
38
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));
39
- const singleAfterFrom = (0, combi_1.seq)(_1.SQLFrom, client, byp, (0, combi_1.altPrio)((0, combi_1.seq)(sqlFields, whereClause, groupHaving, trailingOpts, (0, combi_1.optPrio)(intoSingle)), (0, combi_1.seq)(intoSingle, byp, whereClause, groupHaving, trailingOpts), (0, combi_1.seq)(whereClause, groupHaving, trailingOpts, (0, combi_1.optPrio)(intoSingle))));
40
- const singleIntoBeforeFrom = (0, combi_1.seq)(intoSingle, _1.SQLFrom, client, byp, 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));
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)));
@@ -7,7 +7,7 @@ const _1 = require(".");
7
7
  class FieldLength extends combi_1.Expression {
8
8
  getRunnable() {
9
9
  const normal = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.Plus)), (0, combi_1.altPrio)((0, combi_1.regex)(/^\d+$/), _1.SimpleFieldChain2));
10
- const length = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.optPrio)((0, combi_1.altPrio)(normal, "*")), (0, combi_1.tok)(tokens_1.ParenRightW));
10
+ const length = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.optPrio)((0, combi_1.altPrio)(normal, "*")), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.ParenRight)));
11
11
  return length;
12
12
  }
13
13
  }
@@ -206,6 +206,7 @@ __exportStar(require("./sql_into_structure"), exports);
206
206
  __exportStar(require("./sql_field_list_loop_greedy"), exports);
207
207
  __exportStar(require("./sql_into_table"), exports);
208
208
  __exportStar(require("./sql_join"), exports);
209
+ __exportStar(require("./sql_join_source"), exports);
209
210
  __exportStar(require("./sql_options"), exports);
210
211
  __exportStar(require("./sql_package_size"), exports);
211
212
  __exportStar(require("./sql_order_by"), exports);
@@ -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));
@@ -14,11 +14,12 @@ class SQLCase extends combi_1.Expression {
14
14
  const abap = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2);
15
15
  const field = (0, combi_1.altPrio)(_1.SQLAggregation, SQLCase, _1.SQLFunction, _1.SQLPath, sql_field_name_1.SQLFieldName, constant_1.Constant);
16
16
  const sub = (0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
17
- const sourc = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_field_name_1.SQLFieldName, sql_source_1.SQLSource, constant_1.Constant);
17
+ const source = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_field_name_1.SQLFieldName, sql_source_1.SQLSource, constant_1.Constant);
18
+ const parenSource = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), source, (0, combi_1.tok)(tokens_1.WParenRightW));
18
19
  const val = (0, combi_1.altPrio)(sql_cond_1.SQLCond, constant_1.Constant, abap);
19
- const when = (0, combi_1.seq)("WHEN", val, "THEN", sourc, (0, combi_1.starPrio)(sub));
20
- const els = (0, combi_1.seq)("ELSE", sourc);
21
- return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)((0, combi_1.altPrio)(sql_field_name_1.SQLFieldName, abap)), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(els), "END"), version_1.Version.OpenABAP);
20
+ const when = (0, combi_1.seq)("WHEN", val, "THEN", (0, combi_1.altPrio)(parenSource, (0, combi_1.seq)((0, combi_1.optPrio)("-"), source)), (0, combi_1.starPrio)(sub));
21
+ const else_ = (0, combi_1.seq)("ELSE", (0, combi_1.altPrio)(parenSource, (0, combi_1.seq)((0, combi_1.optPrio)("-"), source)));
22
+ return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)((0, combi_1.altPrio)(sql_field_name_1.SQLFieldName, abap)), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(else_), "END"), version_1.Version.OpenABAP);
22
23
  }
23
24
  }
24
25
  exports.SQLCase = SQLCase;
@@ -4,9 +4,12 @@ exports.SQLClient = void 0;
4
4
  const version_1 = require("../../../version");
5
5
  const combi_1 = require("../combi");
6
6
  const sql_source_simple_1 = require("./sql_source_simple");
7
+ const sql_alias_field_1 = require("./sql_alias_field");
8
+ const dynamic_1 = require("./dynamic");
7
9
  class SQLClient extends combi_1.Expression {
8
10
  getRunnable() {
9
- const client = (0, combi_1.alt)((0, combi_1.verNot)(version_1.Version.Cloud, "CLIENT SPECIFIED"), (0, combi_1.seq)("USING", (0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CLIENT", sql_source_simple_1.SQLSourceSimple)), (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("CLIENTS IN", (0, combi_1.alt)(sql_source_simple_1.SQLSourceSimple, "T000"))), (0, combi_1.ver)(version_1.Version.v754, "ALL CLIENTS"))));
11
+ const clientList = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.alt)(dynamic_1.Dynamic, (0, combi_1.seq)(sql_alias_field_1.SQLAliasField, (0, combi_1.starPrio)((0, combi_1.seq)(",", sql_alias_field_1.SQLAliasField)))));
12
+ const client = (0, combi_1.alt)((0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.seq)("CLIENT SPECIFIED", (0, combi_1.optPrio)(clientList))), (0, combi_1.seq)("USING", (0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CLIENT", sql_source_simple_1.SQLSourceSimple)), (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("CLIENTS IN", (0, combi_1.alt)(sql_source_simple_1.SQLSourceSimple, "T000"))), (0, combi_1.ver)(version_1.Version.v754, "ALL CLIENTS"))));
10
13
  return client;
11
14
  }
12
15
  }
@@ -17,15 +17,13 @@ class SQLField extends combi_1.Expression {
17
17
  const field = (0, combi_1.altPrio)(_1.SQLAggregation, fieldNoAgg);
18
18
  const parenField = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), field, (0, combi_1.tok)(tokens_1.WParenRightW));
19
19
  const parenFieldNoAgg = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), fieldNoAgg, (0, combi_1.tok)(tokens_1.WParenRightW));
20
- // without aggregates: from v740sp05
21
20
  const subNoAgg = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.altPrio)(parenFieldNoAgg, fieldNoAgg)));
22
21
  const arithNoAgg = (0, combi_1.ver)(version_1.Version.v740sp05, subNoAgg);
23
- // with aggregates: from v754
24
22
  const subWithAgg = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.altPrio)(parenField, field)));
25
23
  const arithWithAgg = (0, combi_1.ver)(version_1.Version.v754, subWithAgg);
26
24
  const arith = (0, combi_1.altPrio)(arithWithAgg, arithNoAgg);
27
- const arithSequence = (0, combi_1.seq)(field, (0, combi_1.optPrio)(arith));
28
- const parenArithSequence = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), arithSequence, (0, combi_1.tok)(tokens_1.WParenRightW));
25
+ const arithSequence = (0, combi_1.seq)((0, combi_1.optPrio)("-"), field, (0, combi_1.optPrio)(arith));
26
+ const parenArithSequence = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.optPrio)("-"), arithSequence, (0, combi_1.tok)(tokens_1.WParenRightW));
29
27
  // allows (a-b)*(c-d) — paren groups as operands, defined after parenArithSequence
30
28
  const subExtWithAgg = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.altPrio)(parenArithSequence, parenField, field)));
31
29
  const subExtNoAgg = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.altPrio)(parenArithSequence, parenFieldNoAgg, fieldNoAgg)));
@@ -2,14 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SQLGroupBy = void 0;
4
4
  const combi_1 = require("../combi");
5
+ const version_1 = require("../../../version");
5
6
  const dynamic_1 = require("./dynamic");
6
7
  const sql_field_name_1 = require("./sql_field_name");
8
+ const sql_field_1 = require("./sql_field");
7
9
  class SQLGroupBy extends combi_1.Expression {
8
10
  getRunnable() {
9
- const f = (0, combi_1.alt)(sql_field_name_1.SQLFieldName, dynamic_1.Dynamic);
10
- const strict = (0, combi_1.seq)((0, combi_1.plus)((0, combi_1.seq)(f, ",")), f);
11
- const group = (0, combi_1.seq)("GROUP BY", (0, combi_1.altPrio)(strict, (0, combi_1.plus)(f)));
12
- return group;
11
+ const fieldName = (0, combi_1.alt)(sql_field_name_1.SQLFieldName, dynamic_1.Dynamic);
12
+ const expr = (0, combi_1.ver)(version_1.Version.v740sp02, sql_field_1.SQLField, version_1.Version.OpenABAP);
13
+ const newGroup = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("GROUP BY", expr, (0, combi_1.altPrio)((0, combi_1.plus)((0, combi_1.seq)(",", expr)), (0, combi_1.optPrio)((0, combi_1.plus)(fieldName)))), version_1.Version.OpenABAP);
14
+ const old = (0, combi_1.seq)((0, combi_1.plus)((0, combi_1.seq)(fieldName, ",")), fieldName);
15
+ const oldGroup = (0, combi_1.seq)("GROUP BY", (0, combi_1.altPrio)(old, (0, combi_1.plus)(fieldName)));
16
+ return (0, combi_1.altPrio)(newGroup, oldGroup);
13
17
  }
14
18
  }
15
19
  exports.SQLGroupBy = SQLGroupBy;
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SQLHints = void 0;
4
4
  const combi_1 = require("../combi");
5
- const _1 = require(".");
5
+ const sql_source_1 = require("./sql_source");
6
6
  class SQLHints extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const type = (0, combi_1.altPrio)("ORACLE", "ADABAS", "AS400", "DB2", "HDB", "MSSQLNT", "SYBASE", "DB6", "INFORMIX");
9
- const ret = (0, combi_1.seq)("%_HINTS", (0, combi_1.plus)((0, combi_1.seq)(type, (0, combi_1.alt)(_1.Constant, _1.FieldSub))));
9
+ const ret = (0, combi_1.seq)("%_HINTS", (0, combi_1.plus)((0, combi_1.seq)(type, sql_source_1.SQLSource)));
10
10
  return ret;
11
11
  }
12
12
  }
@@ -6,6 +6,7 @@ const _1 = require(".");
6
6
  const tokens_1 = require("../../1_lexer/tokens");
7
7
  const version_1 = require("../../../version");
8
8
  const sql_set_op_group_1 = require("./sql_set_op_group");
9
+ const _select_core_1 = require("./_select_core");
9
10
  class SQLIn extends combi_1.Expression {
10
11
  getRunnable() {
11
12
  const val = new _1.SQLSource();
@@ -15,7 +16,9 @@ class SQLIn extends combi_1.Expression {
15
16
  // version is a guess, https://github.com/abaplint/abaplint/issues/2530
16
17
  const listNeww = (0, combi_1.ver)(version_1.Version.v740sp02, listNew, version_1.Version.OpenABAP);
17
18
  const subSelect = sql_set_op_group_1.SQLSetOpGroup;
18
- const inn = (0, combi_1.seq)("IN", (0, combi_1.altPrio)(subSelect, listOld, listNeww, _1.SQLSource));
19
+ // simple subquery for pre-v750 versions: IN ( SELECT ... ), https://github.com/abaplint/abaplint/issues/3999
20
+ const simpleSubSelect = (0, combi_1.seq)("(", "SELECT", (0, _select_core_1.buildSelectCore)(undefined, false), ")");
21
+ const inn = (0, combi_1.seq)("IN", (0, combi_1.altPrio)(subSelect, simpleSubSelect, listOld, listNeww, _1.SQLSource));
19
22
  return inn;
20
23
  }
21
24
  }
@@ -4,11 +4,12 @@ exports.SQLJoin = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
6
  const version_1 = require("../../../version");
7
+ const sql_join_source_1 = require("./sql_join_source");
7
8
  class SQLJoin extends combi_1.Expression {
8
9
  getRunnable() {
9
10
  const joinType = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("INNER", "LEFT OUTER", "LEFT", "RIGHT OUTER", "RIGHT")), "JOIN");
10
- const join = (0, combi_1.seq)(joinType, _1.SQLFromSource, "ON", _1.SQLCond);
11
- const crossJoin = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("CROSS JOIN", _1.SQLFromSource), version_1.Version.OpenABAP);
11
+ const join = (0, combi_1.seq)(joinType, new sql_join_source_1.SQLJoinSource(), "ON", _1.SQLCond);
12
+ const crossJoin = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("CROSS JOIN", new sql_join_source_1.SQLJoinSource()), version_1.Version.OpenABAP);
12
13
  return (0, combi_1.altPrio)(crossJoin, join);
13
14
  }
14
15
  }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SQLJoinSource = void 0;
4
+ const combi_1 = require("../combi");
5
+ const _1 = require(".");
6
+ const tokens_1 = require("../../1_lexer/tokens");
7
+ const sql_join_1 = require("./sql_join");
8
+ class SQLJoinSource extends combi_1.Expression {
9
+ getRunnable() {
10
+ const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.altPrio)(new SQLJoinSource(), _1.SQLFromSource), (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), new sql_join_1.SQLJoin())), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
11
+ return (0, combi_1.altPrio)(paren, _1.SQLFromSource);
12
+ }
13
+ }
14
+ exports.SQLJoinSource = SQLJoinSource;
15
+ //# sourceMappingURL=sql_join_source.js.map
@@ -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));
@@ -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
@@ -234,7 +234,9 @@ class MethodParameters {
234
234
  || concat.includes(" FOR DETERMINE ")
235
235
  || concat.includes(" FOR FEATURES ")
236
236
  || concat.includes(" FOR INSTANCE FEATURES ")
237
+ || concat.includes(" FOR GLOBAL AUTHORIZATION ")
237
238
  || concat.includes(" FOR LOCK ")
239
+ || concat.includes(" FOR PRECHECK ")
238
240
  || concat.includes(" FOR NUMBERING ")
239
241
  || concat.includes(" FOR READ ")
240
242
  || concat.includes(" FOR VALIDATION ")
@@ -74,7 +74,7 @@ class Registry {
74
74
  }
75
75
  static abaplintVersion() {
76
76
  // magic, see build script "version.js"
77
- return "2.119.31";
77
+ return "2.119.33";
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.31",
3
+ "version": "2.119.33",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "homepage": "https://abaplint.org",
53
53
  "devDependencies": {
54
- "@microsoft/api-extractor": "^7.58.8",
54
+ "@microsoft/api-extractor": "^7.58.9",
55
55
  "@types/chai": "^4.3.20",
56
56
  "@types/mocha": "^10.0.10",
57
57
  "@types/node": "^24.13.2",
@@ -64,7 +64,7 @@
64
64
  "typescript": "^6.0.3"
65
65
  },
66
66
  "dependencies": {
67
- "fast-xml-parser": "^5.8.0",
67
+ "fast-xml-parser": "^5.9.0",
68
68
  "json5": "^2.2.3",
69
69
  "vscode-languageserver-types": "^3.18.0"
70
70
  }