@abaplint/cli 2.120.2 → 2.120.4

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 (2) hide show
  1. package/build/cli.js +206 -148
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -26953,6 +26953,7 @@ const basic_1 = __webpack_require__(/*! ../types/basic */ "../core/build/src/aba
26953
26953
  const ddic_1 = __webpack_require__(/*! ../../ddic */ "../core/build/src/ddic.js");
26954
26954
  const _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ "../core/build/src/abap/5_syntax/_object_oriented.js");
26955
26955
  const _reference_1 = __webpack_require__(/*! ./_reference */ "../core/build/src/abap/5_syntax/_reference.js");
26956
+ const tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ "../core/build/src/abap/1_lexer/tokens/index.js");
26956
26957
  class Procedural {
26957
26958
  constructor(reg, scope) {
26958
26959
  this.scope = scope;
@@ -27132,7 +27133,8 @@ class Procedural {
27132
27133
  continue;
27133
27134
  }
27134
27135
  else {
27135
- const type = new _typed_identifier_1.TypedIdentifier(nameToken, filename, found);
27136
+ const token = new tokens_1.Identifier(nameToken.getStart(), param.name);
27137
+ const type = new _typed_identifier_1.TypedIdentifier(token, filename, found, this.functionModuleParameterMeta(param));
27136
27138
  if (ignoreIfAlreadyExists === true) {
27137
27139
  const exists = this.scope.findVariable(param.name);
27138
27140
  if (exists === undefined) {
@@ -27146,6 +27148,25 @@ class Procedural {
27146
27148
  }
27147
27149
  }
27148
27150
  }
27151
+ functionModuleParameterMeta(param) {
27152
+ const ret = [];
27153
+ if (param.direction === types_1.FunctionModuleParameterDirection.importing) {
27154
+ ret.push("function_module_importing" /* IdentifierMeta.FunctionModuleImporting */);
27155
+ }
27156
+ else if (param.direction === types_1.FunctionModuleParameterDirection.exporting) {
27157
+ ret.push("function_module_exporting" /* IdentifierMeta.FunctionModuleExporting */);
27158
+ }
27159
+ else if (param.direction === types_1.FunctionModuleParameterDirection.changing) {
27160
+ ret.push("function_module_changing" /* IdentifierMeta.FunctionModuleChanging */);
27161
+ }
27162
+ else if (param.direction === types_1.FunctionModuleParameterDirection.tables) {
27163
+ ret.push("function_module_tables" /* IdentifierMeta.FunctionModuleTables */);
27164
+ }
27165
+ if (param.passByValue) {
27166
+ ret.push("pass_by_value" /* IdentifierMeta.PassByValue */);
27167
+ }
27168
+ return ret;
27169
+ }
27149
27170
  }
27150
27171
  exports.Procedural = Procedural;
27151
27172
  //# sourceMappingURL=_procedural.js.map
@@ -34017,7 +34038,7 @@ const assert_error_1 = __webpack_require__(/*! ../assert_error */ "../core/build
34017
34038
  */
34018
34039
  // TODO: refactor all these method parameters to objects, this is getting messy
34019
34040
  class Source {
34020
- static runSyntax(node, input, targetType, writeReference = false, allowGenericDeference = false) {
34041
+ static runSyntax(node, input, targetType, writeReference = false, allowGenericDeference = false, readReference = true) {
34021
34042
  var _a;
34022
34043
  if (node === undefined) {
34023
34044
  return undefined;
@@ -34195,7 +34216,10 @@ class Source {
34195
34216
  return undefined;
34196
34217
  }
34197
34218
  let context = new unknown_type_1.UnknownType("todo, Source type");
34198
- const type = [_reference_1.ReferenceType.DataReadReference];
34219
+ const type = [];
34220
+ if (readReference) {
34221
+ type.push(_reference_1.ReferenceType.DataReadReference);
34222
+ }
34199
34223
  if (writeReference) {
34200
34224
  type.push(_reference_1.ReferenceType.DataWriteReference);
34201
34225
  }
@@ -37131,7 +37155,8 @@ class CallTransformation {
37131
37155
  const resultParameters = node.findExpressionAfterToken("RESULT");
37132
37156
  const resultSources = new Set((resultParameters === null || resultParameters === void 0 ? void 0 : resultParameters.findAllExpressions(Expressions.SimpleSource3)) || []);
37133
37157
  for (const s of node.findAllExpressions(Expressions.SimpleSource3)) {
37134
- source_1.Source.runSyntax(s, input, undefined, resultSources.has(s));
37158
+ const isResult = resultSources.has(s);
37159
+ source_1.Source.runSyntax(s, input, undefined, isResult, false, isResult === false);
37135
37160
  }
37136
37161
  for (const d of node.findAllExpressions(Expressions.Dynamic)) {
37137
37162
  dynamic_1.Dynamic.runSyntax(d, input);
@@ -37313,7 +37338,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
37313
37338
  exports.Catch = void 0;
37314
37339
  const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
37315
37340
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
37316
- const unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ "../core/build/src/abap/types/basic/unknown_type.js");
37317
37341
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
37318
37342
  const target_1 = __webpack_require__(/*! ../expressions/target */ "../core/build/src/abap/5_syntax/expressions/target.js");
37319
37343
  const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
@@ -37321,7 +37345,7 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/bui
37321
37345
  const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "../core/build/src/abap/5_syntax/_type_utils.js");
37322
37346
  class Catch {
37323
37347
  runSyntax(node, input) {
37324
- var _a, _b;
37348
+ var _a;
37325
37349
  const names = new Set();
37326
37350
  for (const c of node.findDirectExpressions(Expressions.ClassName)) {
37327
37351
  const token = c.getFirstToken();
@@ -37337,7 +37361,6 @@ class Catch {
37337
37361
  else {
37338
37362
  const message = "CATCH, unknown class " + className;
37339
37363
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, message));
37340
- return;
37341
37364
  }
37342
37365
  if (names.has(className)) {
37343
37366
  const message = "Duplicate class name in CATCH: " + className;
@@ -37347,23 +37370,18 @@ class Catch {
37347
37370
  names.add(className);
37348
37371
  }
37349
37372
  const target = node.findDirectExpression(Expressions.Target);
37350
- const firstClassName = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();
37351
37373
  if (target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData)) {
37352
- const token = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.getFirstToken();
37353
- const found = input.scope.existsObject(firstClassName);
37354
- if (token && firstClassName && (found === null || found === void 0 ? void 0 : found.id)) {
37355
- const identifier = new _typed_identifier_1.TypedIdentifier(token, input.filename, new basic_1.ObjectReferenceType(found.id), ["inline" /* IdentifierMeta.InlineDefinition */]);
37356
- input.scope.addIdentifier(identifier);
37357
- input.scope.addReference(token, identifier, _reference_1.ReferenceType.DataWriteReference, input.filename);
37358
- }
37359
- else if (token && input.scope.getDDIC().inErrorNamespace(firstClassName) === false) {
37360
- const identifier = new _typed_identifier_1.TypedIdentifier(token, input.filename, basic_1.VoidType.get(firstClassName), ["inline" /* IdentifierMeta.InlineDefinition */]);
37361
- input.scope.addIdentifier(identifier);
37362
- input.scope.addReference(token, identifier, _reference_1.ReferenceType.DataWriteReference, input.filename);
37363
- }
37364
- else if (token) {
37365
- const message = "Catch, could not determine type for \"" + token.getStr() + "\"";
37366
- const identifier = new _typed_identifier_1.TypedIdentifier(token, input.filename, new unknown_type_1.UnknownType(message), ["inline" /* IdentifierMeta.InlineDefinition */]);
37374
+ const token = (_a = target.findFirstExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
37375
+ if (token) {
37376
+ const classNames = Array.from(names);
37377
+ const unknownClass = classNames.find(name => input.scope.findClassDefinition(name) === undefined);
37378
+ const commonSuperclass = unknownClass === undefined
37379
+ ? this.findCommonSuperclass(classNames, input)
37380
+ : undefined;
37381
+ const type = commonSuperclass
37382
+ ? new basic_1.ObjectReferenceType(commonSuperclass)
37383
+ : basic_1.VoidType.get(unknownClass || classNames.join(" "));
37384
+ const identifier = new _typed_identifier_1.TypedIdentifier(token, input.filename, type, ["inline" /* IdentifierMeta.InlineDefinition */]);
37367
37385
  input.scope.addIdentifier(identifier);
37368
37386
  input.scope.addReference(token, identifier, _reference_1.ReferenceType.DataWriteReference, input.filename);
37369
37387
  }
@@ -37387,6 +37405,22 @@ class Catch {
37387
37405
  }
37388
37406
  }
37389
37407
  }
37408
+ findCommonSuperclass(classNames, input) {
37409
+ var _a;
37410
+ const lineages = [];
37411
+ for (const className of classNames) {
37412
+ const lineage = [];
37413
+ let current = input.scope.findClassDefinition(className);
37414
+ const visited = new Set();
37415
+ while (current && visited.has(current.getName().toUpperCase()) === false) {
37416
+ lineage.push(current);
37417
+ visited.add(current.getName().toUpperCase());
37418
+ current = input.scope.findClassDefinition(current.getSuperClass());
37419
+ }
37420
+ lineages.push(lineage);
37421
+ }
37422
+ return (_a = lineages[0]) === null || _a === void 0 ? void 0 : _a.find(candidate => lineages.every(lineage => lineage.some(item => item.getName().toUpperCase() === candidate.getName().toUpperCase())));
37423
+ }
37390
37424
  }
37391
37425
  exports.Catch = Catch;
37392
37426
  //# sourceMappingURL=catch.js.map
@@ -51704,6 +51738,7 @@ class FunctionModuleDefinition {
51704
51738
  type: param.TYP || param.DBFIELD,
51705
51739
  optional: param.OPTIONAL === "X",
51706
51740
  defaultValue: param.DEFAULT,
51741
+ passByValue: param.REFERENCE !== "X",
51707
51742
  });
51708
51743
  }
51709
51744
  }
@@ -51718,6 +51753,7 @@ class FunctionModuleDefinition {
51718
51753
  type: param.TYP || param.DBFIELD,
51719
51754
  optional: param.OPTIONAL === "X",
51720
51755
  defaultValue: param.DEFAULT,
51756
+ passByValue: param.REFERENCE !== "X",
51721
51757
  });
51722
51758
  }
51723
51759
  }
@@ -51732,6 +51768,7 @@ class FunctionModuleDefinition {
51732
51768
  type: param.TYP || param.DBFIELD,
51733
51769
  optional: true,
51734
51770
  defaultValue: undefined,
51771
+ passByValue: param.REFERENCE !== "X",
51735
51772
  });
51736
51773
  }
51737
51774
  }
@@ -51747,6 +51784,7 @@ class FunctionModuleDefinition {
51747
51784
  type: param.DBSTRUCT || param.TYP,
51748
51785
  optional: param.OPTIONAL === "X",
51749
51786
  defaultValue: undefined,
51787
+ passByValue: false,
51750
51788
  });
51751
51789
  }
51752
51790
  }
@@ -52599,14 +52637,14 @@ class MethodParameters {
52599
52637
  }
52600
52638
  }
52601
52639
  add(target, source, input, meta, abstractMethod) {
52602
- var _a, _b;
52640
+ var _a;
52603
52641
  for (const opt of source.findAllExpressions(Expressions.MethodParamOptional)) {
52604
52642
  const p = opt.findDirectExpression(Expressions.MethodParam);
52605
52643
  if (p === undefined) {
52606
52644
  continue;
52607
52645
  }
52608
52646
  const extraMeta = [];
52609
- if (p.getFirstToken().getStr().toUpperCase() === "VALUE" && ((_a = p.getChildren()[1]) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr()) === "(") {
52647
+ if (this.isPassByValue(p)) {
52610
52648
  extraMeta.push("pass_by_value" /* IdentifierMeta.PassByValue */);
52611
52649
  }
52612
52650
  else if (meta.includes("importing" /* IdentifierMeta.MethodImporting */)) {
@@ -52625,7 +52663,7 @@ class MethodParameters {
52625
52663
  else if (opt.findFirstExpression(Expressions.Default)) {
52626
52664
  const name = target[target.length - 1].getName().toUpperCase();
52627
52665
  this.optional.push(name);
52628
- const val = (_b = opt.findFirstExpression(Expressions.Default)) === null || _b === void 0 ? void 0 : _b.getLastChild();
52666
+ const val = (_a = opt.findFirstExpression(Expressions.Default)) === null || _a === void 0 ? void 0 : _a.getLastChild();
52629
52667
  if (val && val instanceof nodes_1.ExpressionNode) {
52630
52668
  this.defaults[name] = val;
52631
52669
  }
@@ -52636,9 +52674,15 @@ class MethodParameters {
52636
52674
  }
52637
52675
  const params = source.findAllExpressions(Expressions.MethodParam);
52638
52676
  for (const param of params) {
52639
- target.push(method_param_1.MethodParam.runSyntax(param, input, meta));
52677
+ const extraMeta = this.isPassByValue(param) ? ["pass_by_value" /* IdentifierMeta.PassByValue */] : [];
52678
+ target.push(method_param_1.MethodParam.runSyntax(param, input, [...meta, ...extraMeta]));
52640
52679
  }
52641
52680
  }
52681
+ isPassByValue(param) {
52682
+ var _a;
52683
+ return param.getFirstToken().getStr().toUpperCase() === "VALUE"
52684
+ && ((_a = param.getChildren()[1]) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr()) === "(";
52685
+ }
52642
52686
  }
52643
52687
  exports.MethodParameters = MethodParameters;
52644
52688
  //# sourceMappingURL=method_parameters.js.map
@@ -53245,7 +53289,7 @@ class CDSAggregate extends combi_1.Expression {
53245
53289
  getRunnable() {
53246
53290
  const fieldAsType = (0, combi_1.seq)(_1.CDSPrefixedName, "AS", _1.CDSType);
53247
53291
  const funcAsType = (0, combi_1.seq)(_1.CDSFunction, "AS", _1.CDSType);
53248
- const value = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSCast, _1.CDSCase, funcAsType, _1.CDSFunction, fieldAsType, _1.CDSPrefixedName, _1.CDSString, "*");
53292
+ const value = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSArithParen, _1.CDSCast, _1.CDSCase, funcAsType, _1.CDSFunction, fieldAsType, _1.CDSPrefixedName, _1.CDSString, "*");
53249
53293
  return (0, combi_1.seq)((0, combi_1.altPrio)("MAX", "MIN", "SUM", "AVG", "COUNT"), "(", (0, combi_1.optPrio)((0, combi_1.altPrio)("DISTINCT", "ALL")), value, (0, combi_1.opt)((0, combi_1.seq)("AS", _1.CDSType)), ")");
53250
53294
  }
53251
53295
  }
@@ -53370,9 +53414,10 @@ class CDSAnnotationSimple extends combi_1.Expression {
53370
53414
  getRunnable() {
53371
53415
  const ident = (0, combi_1.regex)(/^[\w_]+$/);
53372
53416
  // #(expr) where expr can be: identifier, dotted path, string, or concatenation with +
53373
- const hashArg = (0, combi_1.altPrio)(_1.CDSString, cds_prefixed_name_1.CDSPrefixedName, ident);
53417
+ const funcCall = (0, combi_1.seq)(ident, "(", (0, combi_1.altPrio)(_1.CDSString, cds_prefixed_name_1.CDSPrefixedName, ident), ")");
53418
+ const hashArg = (0, combi_1.altPrio)(_1.CDSString, funcCall, cds_prefixed_name_1.CDSPrefixedName, ident);
53374
53419
  const hashExpr = (0, combi_1.seq)(hashArg, (0, combi_1.starPrio)((0, combi_1.seq)("+", hashArg)));
53375
- const value = (0, combi_1.altPrio)(_1.CDSString, "true", "false", "null", (0, combi_1.seq)("-", (0, combi_1.regex)(/^\d+$/), ".", (0, combi_1.regex)(/^\d+$/)), (0, combi_1.seq)("-", (0, combi_1.regex)(/^\d+$/)), (0, combi_1.seq)((0, combi_1.regex)(/^\d+$/), ".", (0, combi_1.regex)(/^\d+$/)), (0, combi_1.regex)(/^\d+$/), (0, combi_1.seq)("#", "(", hashExpr, ")"), (0, combi_1.regex)(/^#[\w_]+$/));
53420
+ const value = (0, combi_1.altPrio)(_1.CDSString, "true", "false", "null", (0, combi_1.seq)("-", (0, combi_1.regex)(/^\d+$/), ".", (0, combi_1.regex)(/^\d+[eE]$/), (0, combi_1.altPrio)("+", "-"), (0, combi_1.regex)(/^\d+$/)), (0, combi_1.seq)((0, combi_1.regex)(/^\d+$/), ".", (0, combi_1.regex)(/^\d+[eE]$/), (0, combi_1.altPrio)("+", "-"), (0, combi_1.regex)(/^\d+$/)), (0, combi_1.seq)("-", (0, combi_1.regex)(/^\d+$/), ".", (0, combi_1.regex)(/^\d+$/)), (0, combi_1.seq)("-", (0, combi_1.regex)(/^\d+$/)), (0, combi_1.seq)((0, combi_1.regex)(/^\d+$/), ".", (0, combi_1.regex)(/^\d+$/)), (0, combi_1.regex)(/^\d+$/), (0, combi_1.seq)("#", "(", hashExpr, ")"), (0, combi_1.regex)(/^#[\w_]+$/));
53376
53421
  return value;
53377
53422
  }
53378
53423
  }
@@ -53530,9 +53575,9 @@ class CDSAssociation extends combi_1.Expression {
53530
53575
  const numericCardinality = (0, combi_1.seq)("[", cardNum, (0, combi_1.optPrio)((0, combi_1.seq)(".", ".", cardNum)), "]");
53531
53576
  // Text-based OF form: "association of one to many Target on ..." — text cardinality includes "TO"
53532
53577
  const ofTextSide = (0, combi_1.altPrio)((0, combi_1.seq)("EXACT", "ONE"), "ONE", "MANY");
53533
- const ofTextForm = (0, combi_1.seq)("ASSOCIATION", "OF", ofTextSide, "TO", ofTextSide, _1.CDSRelation, "ON", _1.CDSCondition);
53578
+ const ofTextForm = (0, combi_1.seq)("ASSOCIATION", "OF", ofTextSide, "TO", ofTextSide, _1.CDSRelation, "ON", _1.CDSCondition, (0, combi_1.opt)((0, combi_1.seq)("WITH", "DEFAULT", "FILTER", _1.CDSCondition)));
53534
53579
  // Numeric OF form: "association of [0..1] to Target on ..."
53535
- const ofNumericForm = (0, combi_1.seq)("ASSOCIATION", "OF", numericCardinality, "TO", _1.CDSRelation, "ON", _1.CDSCondition);
53580
+ const ofNumericForm = (0, combi_1.seq)("ASSOCIATION", "OF", numericCardinality, "TO", _1.CDSRelation, "ON", _1.CDSCondition, (0, combi_1.opt)((0, combi_1.seq)("WITH", "DEFAULT", "FILTER", _1.CDSCondition)));
53536
53581
  // "association [0..1] to Target as _Alias on condition" — standard form
53537
53582
  const parentForm = (0, combi_1.seq)("ASSOCIATION", "TO", "PARENT", _1.CDSRelation);
53538
53583
  const standardForm = (0, combi_1.seq)("ASSOCIATION", (0, combi_1.optPrio)(cds_cardinality_1.CDSCardinality), "TO", (0, combi_1.opt)((0, combi_1.altPrio)(textCardinality, "PARENT")), _1.CDSRelation, "ON", _1.CDSCondition, (0, combi_1.opt)((0, combi_1.seq)("WITH", "DEFAULT", "FILTER", _1.CDSCondition)));
@@ -53590,7 +53635,7 @@ class CDSCase extends combi_1.Expression {
53590
53635
  // CDSArithmetics is still tried after for arithmetic like (-1)*Amount or (2*A)-B.
53591
53636
  const caseParen = (0, combi_1.seq)("(", CDSCase, ")");
53592
53637
  const value = (0, combi_1.altPrio)(_1.CDSString, CDSCase, caseParen, _1.CDSArithmetics, _1.CDSCast, _1.CDSAggregate, _1.CDSArithParen, _1.CDSFunction, _1.CDSInteger, _1.CDSPrefixedName);
53593
- const simple = (0, combi_1.seq)((0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSArithParen, _1.CDSAggregate, _1.CDSFunction, _1.CDSPrefixedName), (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", value, "THEN", value)));
53638
+ const simple = (0, combi_1.seq)((0, combi_1.altPrio)(_1.CDSString, _1.CDSCast, _1.CDSArithmetics, _1.CDSArithParen, _1.CDSAggregate, _1.CDSFunction, _1.CDSPrefixedName), (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", value, "THEN", value)));
53594
53639
  const complex = (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", _1.CDSCondition, "THEN", value));
53595
53640
  return (0, combi_1.seq)("CASE", (0, combi_1.altPrio)(complex, simple), (0, combi_1.optPrio)((0, combi_1.seq)("ELSE", value)), "END");
53596
53641
  }
@@ -53615,7 +53660,7 @@ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../cor
53615
53660
  class CDSCast extends combi_1.Expression {
53616
53661
  getRunnable() {
53617
53662
  // CDSArithmetics before CDSFunction/CDSAggregate: handles function()*n, cast()*n, sum()*n patterns
53618
- const first = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSFunction, _1.CDSArithParen, _1.CDSCase, _1.CDSAggregate, CDSCast, _1.CDSString, _1.CDSPrefixedName, _1.CDSInteger);
53663
+ const first = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSFunction, _1.CDSArithParen, _1.CDSCase, _1.CDSAggregate, CDSCast, _1.CDSInteger, _1.CDSString, _1.CDSPrefixedName);
53619
53664
  return (0, combi_1.seq)("CAST", "(", first, "AS", _1.CDSType, (0, combi_1.optPrio)((0, combi_1.seq)("PRESERVING", "TYPE")), ")");
53620
53665
  }
53621
53666
  }
@@ -53640,8 +53685,9 @@ const cds_cardinality_1 = __webpack_require__(/*! ./cds_cardinality */ "../core/
53640
53685
  class CDSComposition extends combi_1.Expression {
53641
53686
  getRunnable() {
53642
53687
  const num = (0, combi_1.altPrio)("ONE", "MANY");
53643
- // Text cardinality after OF: "of exact one to many", "of one to many", or bare "of many" / "of one"
53644
- const textCardinality = (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.opt)("EXACT"), num, "TO", num), (0, combi_1.seq)((0, combi_1.opt)("EXACT"), num));
53688
+ const exactNum = (0, combi_1.seq)((0, combi_1.opt)("EXACT"), num);
53689
+ // Text cardinality after OF: "of exact one to exact one", "of exact one to many", "of one to many", or bare "of many" / "of one"
53690
+ const textCardinality = (0, combi_1.altPrio)((0, combi_1.seq)(exactNum, "TO", exactNum), (0, combi_1.seq)((0, combi_1.opt)("EXACT"), num));
53645
53691
  // Numeric cardinality [n..m] before OF: any non-negative integer or *
53646
53692
  const cardNum = (0, combi_1.altPrio)((0, combi_1.regex)(/^\d+$/), "*");
53647
53693
  const numericCardinality = (0, combi_1.seq)("[", cardNum, (0, combi_1.optPrio)((0, combi_1.seq)(".", ".", cardNum)), "]");
@@ -53670,7 +53716,7 @@ class CDSCondition extends combi_1.Expression {
53670
53716
  getRunnable() {
53671
53717
  // CDSArithmetics before CDSCast/CDSFunction so cast(A)-cast(B) is handled as arithmetic, not two separate casts
53672
53718
  // CDSCase allows nested case expressions on either side of a comparison
53673
- const left = (0, combi_1.altPrio)(_1.CDSString, _1.CDSArithmetics, _1.CDSCast, _1.CDSFunction, _1.CDSAggregate, _1.CDSCase, _1.CDSArithParen, _1.CDSPrefixedName);
53719
+ const left = (0, combi_1.altPrio)(_1.CDSString, _1.CDSArithmetics, _1.CDSCast, _1.CDSFunction, _1.CDSAggregate, _1.CDSCase, _1.CDSArithParen, cds_integer_1.CDSInteger, _1.CDSPrefixedName);
53674
53720
  const nonLikeOperators = (0, combi_1.altPrio)("=", (0, combi_1.seq)("!", "="), (0, combi_1.seq)("<", ">"), (0, combi_1.seq)(">", "="), (0, combi_1.seq)("<", "="), "<", ">");
53675
53721
  const likeOperators = (0, combi_1.altPrio)("LIKE", "NOT LIKE");
53676
53722
  // Right side of comparison: simple values first, then parenthesized, then full arithmetic last.
@@ -53734,7 +53780,7 @@ class CDSDefineCustom extends combi_1.Expression {
53734
53780
  getRunnable() {
53735
53781
  const field = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.str)("KEY")), cds_name_1.CDSName, ":", cds_type_1.CDSType, ";");
53736
53782
  const compsiOrAssoci = (0, combi_1.seq)(cds_name_1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
53737
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), (0, combi_1.opt)("ROOT"), (0, combi_1.str)("CUSTOM ENTITY"), cds_name_1.CDSName, (0, combi_1.opt)(_1.CDSWithParameters), (0, combi_1.str)("{"), (0, combi_1.plus)((0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.alt)(field, compsiOrAssoci))), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
53783
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)((0, combi_1.str)("DEFINE")), (0, combi_1.opt)((0, combi_1.str)("ROOT")), (0, combi_1.str)("CUSTOM ENTITY"), cds_name_1.CDSName, (0, combi_1.opt)(_1.CDSWithParameters), (0, combi_1.str)("{"), (0, combi_1.plus)((0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.alt)(field, compsiOrAssoci))), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
53738
53784
  }
53739
53785
  }
53740
53786
  exports.CDSDefineCustom = CDSDefineCustom;
@@ -53756,7 +53802,7 @@ const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index
53756
53802
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
53757
53803
  class CDSDefineExternalEntity extends combi_1.Expression {
53758
53804
  getRunnable() {
53759
- const extNameValue = (0, combi_1.alt)(_1.CDSName, (0, combi_1.regex)(/^"[^"]*"$/));
53805
+ const extNameValue = (0, combi_1.alt)(_1.CDSName, (0, combi_1.regex)(/^"(?:[^"]|"")*"$/));
53760
53806
  const externalName = (0, combi_1.seq)("EXTERNAL", "NAME", extNameValue);
53761
53807
  const nullability = (0, combi_1.optPrio)((0, combi_1.alt)("NOT NULL", "NULL"));
53762
53808
  const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.str)("KEY")), _1.CDSName, ":", _1.CDSType, nullability, (0, combi_1.optPrio)(externalName), ";");
@@ -53764,7 +53810,7 @@ class CDSDefineExternalEntity extends combi_1.Expression {
53764
53810
  const body = (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp));
53765
53811
  const externalEntity = (0, combi_1.seq)((0, combi_1.opt)("WRITABLE"), "EXTERNAL", "ENTITY", _1.CDSName, (0, combi_1.opt)(externalName), (0, combi_1.opt)(_1.CDSWithParameters));
53766
53812
  const staticEntity = (0, combi_1.seq)("STATIC", "ENTITY", _1.CDSName, (0, combi_1.opt)(externalName));
53767
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), (0, combi_1.alt)(externalEntity, staticEntity), (0, combi_1.str)("{"), body, (0, combi_1.str)("}"), (0, combi_1.opt)((0, combi_1.seq)("WITH", "FEDERATED", "DATA", (0, combi_1.optPrio)((0, combi_1.alt)((0, combi_1.seq)("PROVIDED", "AT", "RUNTIME"), (0, combi_1.seq)("PROVIDED", "BY", _1.CDSName))))), (0, combi_1.opt)(";"));
53813
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), (0, combi_1.opt)("ROOT"), (0, combi_1.alt)(externalEntity, staticEntity), (0, combi_1.str)("{"), body, (0, combi_1.str)("}"), (0, combi_1.opt)((0, combi_1.seq)("WITH", "FEDERATED", "DATA", (0, combi_1.optPrio)((0, combi_1.alt)((0, combi_1.seq)("PROVIDED", "AT", "RUNTIME"), (0, combi_1.seq)("PROVIDED", "BY", _1.CDSName))), (0, combi_1.optPrio)((0, combi_1.seq)("ON", "UNLINKED", (0, combi_1.altPrio)("FAIL", "IGNORE"))))), (0, combi_1.opt)(";"));
53768
53814
  }
53769
53815
  }
53770
53816
  exports.CDSDefineExternalEntity = CDSDefineExternalEntity;
@@ -53792,10 +53838,10 @@ class CDSDefineHierarchy extends combi_1.Expression {
53792
53838
  const siblingsOrder = (0, combi_1.seq)("SIBLINGS", "ORDER", "BY", siblingsOrderField, (0, combi_1.star)((0, combi_1.seq)(",", siblingsOrderField)));
53793
53839
  const directory = (0, combi_1.seq)("DIRECTORY", _1.CDSName, "FILTER", "BY", _1.CDSCondition);
53794
53840
  // DATE PERIOD: period from <field> to <field> [valid from :p to :p]
53795
- const datePeriod = (0, combi_1.seq)("PERIOD", "FROM", _1.CDSName, "TO", _1.CDSName, (0, combi_1.opt)((0, combi_1.seq)("VALID", "FROM", _1.CDSPrefixedName, "TO", _1.CDSPrefixedName)));
53841
+ const datePeriod = (0, combi_1.seq)("PERIOD", "FROM", _1.CDSName, "TO", _1.CDSName, (0, combi_1.opt)((0, combi_1.seq)("VALID", "FROM", (0, combi_1.altPrio)(_1.CDSString, _1.CDSPrefixedName), "TO", (0, combi_1.altPrio)(_1.CDSString, _1.CDSPrefixedName))));
53796
53842
  const depthValue = (0, combi_1.altPrio)(_1.CDSString, _1.CDSInteger, _1.CDSPrefixedName);
53797
53843
  const loadMode = (0, combi_1.altPrio)("BULK", "INCREMENTAL", _1.CDSPrefixedName);
53798
- const hierarchyBody = (0, combi_1.seq)("SOURCE", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), "CHILD", "TO", "PARENT", "ASSOCIATION", _1.CDSName, (0, combi_1.opt)(directory), (0, combi_1.opt)(datePeriod), (0, combi_1.opt)((0, combi_1.seq)("START", "WHERE", _1.CDSCondition)), (0, combi_1.opt)(siblingsOrder), (0, combi_1.opt)((0, combi_1.seq)("LOAD", loadMode)), (0, combi_1.opt)((0, combi_1.seq)("DEPTH", depthValue)), (0, combi_1.opt)((0, combi_1.seq)("NODETYPE", _1.CDSName)), (0, combi_1.opt)((0, combi_1.seq)("MULTIPLE", "PARENTS", (0, combi_1.altPrio)("NOT ALLOWED", "ALLOWED", (0, combi_1.seq)("LEAVES", (0, combi_1.optPrio)("ONLY"))))), (0, combi_1.opt)((0, combi_1.seq)("ORPHANS", (0, combi_1.altPrio)("IGNORE", "ROOT", "ERROR"))), (0, combi_1.opt)((0, combi_1.seq)("CYCLES", (0, combi_1.altPrio)("BREAKUP", "ERROR"))), (0, combi_1.opt)((0, combi_1.seq)("GENERATE", "SPANTREE")), (0, combi_1.opt)((0, combi_1.seq)("CACHE", (0, combi_1.altPrio)("ON", "OFF", "FORCE"))));
53844
+ const hierarchyBody = (0, combi_1.seq)("SOURCE", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), "CHILD", "TO", "PARENT", "ASSOCIATION", _1.CDSName, (0, combi_1.opt)((0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.opt)(directory), datePeriod, (0, combi_1.opt)(directory)), (0, combi_1.seq)(datePeriod, (0, combi_1.opt)(directory)), directory)), (0, combi_1.opt)((0, combi_1.seq)("START", "WHERE", _1.CDSCondition)), (0, combi_1.opt)(siblingsOrder), (0, combi_1.opt)((0, combi_1.seq)("DEPTH", depthValue)), (0, combi_1.opt)((0, combi_1.seq)("NODETYPE", _1.CDSName)), (0, combi_1.opt)((0, combi_1.seq)("LOAD", loadMode)), (0, combi_1.opt)((0, combi_1.seq)("MULTIPLE", "PARENTS", (0, combi_1.altPrio)("NOT ALLOWED", "ALLOWED", (0, combi_1.seq)("LEAVES", (0, combi_1.optPrio)("ONLY"))))), (0, combi_1.opt)((0, combi_1.seq)("ORPHANS", (0, combi_1.altPrio)("IGNORE", "ROOT", "ERROR"))), (0, combi_1.opt)((0, combi_1.seq)("CYCLES", (0, combi_1.altPrio)("BREAKUP", "ERROR"))), (0, combi_1.opt)((0, combi_1.seq)("GENERATE", "SPANTREE")), (0, combi_1.opt)((0, combi_1.seq)("CACHE", (0, combi_1.altPrio)("ON", "OFF", "FORCE"))));
53799
53845
  return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), "HIERARCHY", _1.CDSName, (0, combi_1.opt)(_1.CDSWithParameters), "AS", "PARENT", "CHILD", "HIERARCHY", "(", hierarchyBody, ")", "{", (0, combi_1.seq)(field, (0, combi_1.star)((0, combi_1.seq)(",", field))), "}", (0, combi_1.opt)(";"));
53800
53846
  }
53801
53847
  }
@@ -53819,9 +53865,14 @@ const __1 = __webpack_require__(/*! ../.. */ "../core/build/src/index.js");
53819
53865
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
53820
53866
  class CDSDefineProjection extends combi_1.Expression {
53821
53867
  getRunnable() {
53822
- // redefine association _Assoc redirected to [composition child | parent] Entity
53823
- const redefineAssoc = (0, combi_1.seq)("REDEFINE", "ASSOCIATION", _1.CDSName, "REDIRECTED", "TO", (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("COMPOSITION", "CHILD"), "PARENT")), _1.CDSName);
53824
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), (0, combi_1.opt)("ROOT"), (0, combi_1.opt)("TRANSIENT"), "VIEW", (0, combi_1.ver)(__1.Release.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, (0, combi_1.opt)(_1.CDSProviderContract), (0, combi_1.opt)(_1.CDSWithParameters), "AS PROJECTION ON", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSAssociation, redefineAssoc)), (0, combi_1.str)("{"), (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(",")), (0, combi_1.str)("}"), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)(";"));
53868
+ const redefineCard = (0, combi_1.altPrio)("EXACT ONE TO EXACT ONE", "EXACT ONE TO MANY", "EXACT ONE TO ONE", "MANY TO EXACT ONE", "MANY TO MANY", "MANY TO ONE", "ONE TO EXACT ONE", "ONE TO MANY", "ONE TO ONE", "TO EXACT ONE", "TO ONE", "TO MANY", _1.CDSInteger, "*");
53869
+ const redefineAssocFilter = (0, combi_1.seq)("[", (0, combi_1.optPrio)((0, combi_1.seq)(redefineCard, ":")), _1.CDSCondition, "]");
53870
+ const redefineAssoc = (0, combi_1.seq)("REDEFINE", "ASSOCIATION", _1.CDSPrefixedName, (0, combi_1.optPrio)(redefineAssocFilter), (0, combi_1.opt)(_1.CDSAs), "REDIRECTED", "TO", (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("COMPOSITION", "CHILD"), "PARENT")), _1.CDSName);
53871
+ const typedLiteralVal = (0, combi_1.seq)(_1.CDSType, _1.CDSString);
53872
+ const aspectValue = (0, combi_1.altPrio)(typedLiteralVal, _1.CDSString, _1.CDSPrefixedName);
53873
+ const aspectBinding = (0, combi_1.seq)(_1.CDSPrefixedName, "=", ">", aspectValue);
53874
+ const bindAspect = (0, combi_1.seq)("BIND", "ASPECT", _1.CDSName, "(", aspectBinding, (0, combi_1.starPrio)((0, combi_1.seq)(",", aspectBinding)), ")", (0, combi_1.optPrio)((0, combi_1.seq)("AS", _1.CDSName)));
53875
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), (0, combi_1.opt)("TRANSIENT"), (0, combi_1.opt)("ROOT"), "VIEW", (0, combi_1.ver)(__1.Release.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, (0, combi_1.opt)(_1.CDSProviderContract), (0, combi_1.opt)(_1.CDSWithParameters), "AS PROJECTION ON", _1.CDSName, (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSAssociation, redefineAssoc)), (0, combi_1.starPrio)(bindAspect), (0, combi_1.str)("{"), (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(",")), (0, combi_1.str)("}"), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)(";"));
53825
53876
  }
53826
53877
  }
53827
53878
  exports.CDSDefineProjection = CDSDefineProjection;
@@ -53901,9 +53952,9 @@ const cds_with_parameters_1 = __webpack_require__(/*! ./cds_with_parameters */ "
53901
53952
  class CDSDefineView extends combi_1.Expression {
53902
53953
  getRunnable() {
53903
53954
  const columnAlias = (0, combi_1.seq)("(", cds_name_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(",", cds_name_1.CDSName)), ")");
53904
- const parenSelect = (0, combi_1.seq)("(", cds_select_1.CDSSelect, ")");
53905
- const unionBranch = (0, combi_1.altPrio)(parenSelect, cds_select_1.CDSSelect);
53906
- const topLevelSelect = (0, combi_1.altPrio)((0, combi_1.seq)(parenSelect, (0, combi_1.star)((0, combi_1.altPrio)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), unionBranch), (0, combi_1.seq)("EXCEPT", unionBranch), (0, combi_1.seq)("INTERSECT", unionBranch)))), cds_select_1.CDSSelect);
53955
+ const unionBranch = (0, combi_1.altPrio)(_1.CDSParenSelect, cds_select_1.CDSSelect);
53956
+ const unionOps = (0, combi_1.star)((0, combi_1.altPrio)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), unionBranch), (0, combi_1.seq)("EXCEPT", unionBranch), (0, combi_1.seq)("INTERSECT", unionBranch)));
53957
+ const topLevelSelect = (0, combi_1.altPrio)((0, combi_1.seq)(_1.CDSParenSelect, unionOps), (0, combi_1.seq)(cds_select_1.CDSSelect, unionOps));
53907
53958
  return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)("DEFINE"), (0, combi_1.opt)("ROOT"), (0, combi_1.opt)("WRITABLE"), "VIEW", (0, combi_1.ver)(__1.Release.v755, (0, combi_1.opt)("ENTITY")), cds_name_1.CDSName, (0, combi_1.opt)(columnAlias), (0, combi_1.opt)(cds_with_parameters_1.CDSWithParameters), "AS", topLevelSelect, (0, combi_1.opt)((0, combi_1.seq)("WITH", "HIERARCHY", cds_name_1.CDSName)), (0, combi_1.opt)(";"));
53908
53959
  }
53909
53960
  }
@@ -53928,16 +53979,16 @@ const cds_as_1 = __webpack_require__(/*! ./cds_as */ "../core/build/src/cds/expr
53928
53979
  const cds_cast_1 = __webpack_require__(/*! ./cds_cast */ "../core/build/src/cds/expressions/cds_cast.js");
53929
53980
  class CDSElement extends combi_1.Expression {
53930
53981
  getRunnable() {
53931
- const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.optPrio)((0, combi_1.altPrio)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
53982
+ const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.optPrio)((0, combi_1.altPrio)("PARENT", "COMPOSITION CHILD")), _1.CDSName, (0, combi_1.optPrio)(_1.CDSParametersSelect));
53932
53983
  const colonThing = (0, combi_1.seq)(":", (0, combi_1.altPrio)(_1.CDSType, _1.CDSName, "LOCALIZED"));
53933
53984
  const extensionWildcard = (0, combi_1.seq)("$extension", ".", "*");
53934
53985
  const excludingNames = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.CDSName)));
53935
53986
  const excluding = (0, combi_1.seq)("EXCLUDING", "{", excludingNames, "}");
53936
- const includeElement = (0, combi_1.seq)("INCLUDE", _1.CDSPrefixedName, (0, combi_1.optPrio)(excluding), (0, combi_1.optPrio)("SIGNATURE ONLY"));
53987
+ const includeElement = (0, combi_1.seq)("INCLUDE", (0, combi_1.stopBefore1)("AS", "KEY", "VIRTUAL", "}"), _1.CDSPrefixedName, (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("SIGNATURE ONLY", (0, combi_1.optPrio)(excluding)), (0, combi_1.seq)(excluding, (0, combi_1.optPrio)("SIGNATURE ONLY")))));
53937
53988
  const typedVirtual = (0, combi_1.seq)("VIRTUAL", _1.CDSName, ":", _1.CDSType);
53938
53989
  const pathSegment = (0, combi_1.seq)(".", (0, combi_1.altPrio)(_1.CDSString, _1.CDSName, "*"), (0, combi_1.optPrio)((0, combi_1.altPrio)(_1.CDSParametersSelect, _1.CDSParameters)));
53939
53990
  const funcWithPath = (0, combi_1.seq)(_1.CDSFunction, (0, combi_1.plusPrio)(pathSegment));
53940
- const body = (0, combi_1.altPrio)(extensionWildcard, includeElement, _1.CDSArithmetics, _1.CDSAggregate, _1.CDSString, _1.CDSArithParen, funcWithPath, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(cds_as_1.CDSAs), (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonThing))), _1.CDSInteger);
53991
+ const body = (0, combi_1.altPrio)(extensionWildcard, includeElement, _1.CDSArithmetics, _1.CDSAggregate, _1.CDSString, _1.CDSArithParen, funcWithPath, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), _1.CDSInteger, (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.optPrio)(cds_as_1.CDSAs), (0, combi_1.optPrio)((0, combi_1.altPrio)(redirected, colonThing))));
53941
53992
  const elementBody = (0, combi_1.altPrio)(typedVirtual, (0, combi_1.seq)((0, combi_1.altPrio)("KEY", "VIRTUAL"), body), body);
53942
53993
  return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), elementBody, (0, combi_1.optPrio)(cds_as_1.CDSAs), (0, combi_1.starPrio)(_1.CDSAnnotation));
53943
53994
  }
@@ -53963,10 +54014,20 @@ class CDSExtendView extends combi_1.Expression {
53963
54014
  getRunnable() {
53964
54015
  const namedot = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)), (0, combi_1.optPrio)(_1.CDSAs));
53965
54016
  const valueNested = (0, combi_1.seq)("{", namedot, (0, combi_1.star)((0, combi_1.seq)(",", namedot)), "}");
53966
- const redefineAssoc = (0, combi_1.seq)("REDEFINE", "ASSOCIATION", _1.CDSPrefixedName, (0, combi_1.optPrio)((0, combi_1.seq)("[", _1.CDSCondition, "]")), (0, combi_1.opt)(_1.CDSAs), "REDIRECTED", "TO", (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("COMPOSITION", "CHILD"), "PARENT")), _1.CDSName);
54017
+ const redefineCard = (0, combi_1.altPrio)("EXACT ONE TO EXACT ONE", "EXACT ONE TO MANY", "EXACT ONE TO ONE", "MANY TO EXACT ONE", "MANY TO MANY", "MANY TO ONE", "ONE TO EXACT ONE", "ONE TO MANY", "ONE TO ONE", "TO EXACT ONE", "TO ONE", "TO MANY", _1.CDSInteger, "*");
54018
+ const redefineAssocFilter = (0, combi_1.seq)("[", (0, combi_1.optPrio)((0, combi_1.seq)(redefineCard, ":")), _1.CDSCondition, "]");
54019
+ const redefineAssoc = (0, combi_1.seq)("REDEFINE", "ASSOCIATION", _1.CDSPrefixedName, (0, combi_1.optPrio)(redefineAssocFilter), (0, combi_1.opt)(_1.CDSAs), "REDIRECTED", "TO", (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)("COMPOSITION", "CHILD"), "PARENT")), _1.CDSName);
53967
54020
  const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
53968
54021
  const elementNested = (0, combi_1.seq)("{", (0, combi_1.altPrio)("*", elementList), "}");
53969
- const extendView = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("EXTEND VIEW"), (0, combi_1.opt)((0, combi_1.str)("ENTITY")), _1.CDSName, (0, combi_1.str)("WITH"), (0, combi_1.opt)(_1.CDSName), (0, combi_1.star)(redefineAssoc), (0, combi_1.star)(_1.CDSAssociation), (0, combi_1.altPrio)(elementNested, valueNested), (0, combi_1.opt)(";"));
54022
+ const unionElemList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
54023
+ const unionBranchBody = (0, combi_1.seq)((0, combi_1.star)((0, combi_1.altPrio)(_1.CDSAssociation, _1.CDSComposition)), "{", (0, combi_1.altPrio)("*", unionElemList), "}", (0, combi_1.optPrio)(_1.CDSGroupBy));
54024
+ const parenUnionBody = (0, combi_1.seq)("(", (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSAssociation, _1.CDSComposition)), "{", (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(",")), "}", (0, combi_1.star)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSAssociation, _1.CDSComposition)), "{", (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(",")), "}")), ")");
54025
+ const unionSuffix = (0, combi_1.seq)((0, combi_1.optPrio)(_1.CDSGroupBy), (0, combi_1.star)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), (0, combi_1.altPrio)(parenUnionBody, unionBranchBody))));
54026
+ const typedLiteralVal = (0, combi_1.seq)(_1.CDSType, _1.CDSString);
54027
+ const aspectValue = (0, combi_1.altPrio)(typedLiteralVal, _1.CDSString, _1.CDSPrefixedName);
54028
+ const aspectBinding = (0, combi_1.seq)(_1.CDSPrefixedName, "=", ">", aspectValue);
54029
+ const bindAspect = (0, combi_1.seq)("BIND", "ASPECT", _1.CDSName, "(", aspectBinding, (0, combi_1.starPrio)((0, combi_1.seq)(",", aspectBinding)), ")", (0, combi_1.optPrio)((0, combi_1.seq)("AS", _1.CDSName)));
54030
+ const extendView = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("EXTEND VIEW"), (0, combi_1.opt)((0, combi_1.str)("ENTITY")), _1.CDSName, (0, combi_1.str)("WITH"), (0, combi_1.opt)(_1.CDSName), (0, combi_1.star)(redefineAssoc), (0, combi_1.star)((0, combi_1.altPrio)(_1.CDSAssociation, _1.CDSComposition)), (0, combi_1.starPrio)(bindAspect), (0, combi_1.altPrio)(parenUnionBody, elementNested, valueNested), unionSuffix, (0, combi_1.opt)(";"));
53970
54031
  const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.str)("KEY")), _1.CDSName, ":", _1.CDSType, ";");
53971
54032
  const assocOrComp = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
53972
54033
  const entityBody = (0, combi_1.seq)("{", (0, combi_1.plus)((0, combi_1.alt)(field, assocOrComp)), "}");
@@ -54046,6 +54107,7 @@ class CDSFunction extends combi_1.Expression {
54046
54107
  const occurrencesRegexpr = (0, combi_1.seq)("OCCURRENCES_REGEXPR", "(", conversionInputs, ")");
54047
54108
  const substrRegexpr = (0, combi_1.seq)("SUBSTR_REGEXPR", "(", conversionInputs, ")");
54048
54109
  const locateRegexpr = (0, combi_1.seq)("LOCATE_REGEXPR", "(", conversionInputs, ")");
54110
+ const sqrt = (0, combi_1.seq)("SQRT", "(", _1.CDSFunctionInput, ")");
54049
54111
  const extFuncName = (0, combi_1.regex)(/^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/i);
54050
54112
  const genericArgs = (0, combi_1.seq)(_1.CDSFunctionInput, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.CDSFunctionInput)));
54051
54113
  const namedArgValue = (0, combi_1.altPrio)((0, combi_1.seq)("INTERVAL", _1.CDSFunctionInput, _1.CDSName), _1.CDSFunctionInput, _1.CDSName);
@@ -54053,7 +54115,7 @@ class CDSFunction extends combi_1.Expression {
54053
54115
  const namedArgColon = (0, combi_1.seq)(_1.CDSName, ":", namedArgValue);
54054
54116
  const namedArgs = (0, combi_1.seq)((0, combi_1.altPrio)(namedArgArrow, namedArgColon), (0, combi_1.starPrio)((0, combi_1.seq)(",", (0, combi_1.altPrio)(namedArgArrow, namedArgColon))));
54055
54117
  const genericFunc = (0, combi_1.seq)(extFuncName, "(", (0, combi_1.optPrio)((0, combi_1.altPrio)(namedArgs, genericArgs)), ")");
54056
- return (0, combi_1.altPrio)(substring, coalesce, tstmp_to_dats, concat, tstmp_to_tims, upper, lower, abs, ceil, floor, round, div, division, concat_with_space, dats_is_valid, tims_is_valid, dats_days_between, tstmp_add_seconds, tstmp_seconds_between, tstmp_current_utctimestamp, tstmp_is_valid, utcl_current, abap_system_timezone, abap_user_timezone, bintohex, hextobin, dats_add_days, dats_add_months, tstmp_to_dst, dats_tims_to_tstmp, mod, left, right, lpad, rpad, instr, length, ltrim, rtrim, replace, unitConversion, currencyConversion, decimalShift, fltp_to_dec, ratioOf, replaceRegexpr, matchesRegexpr, occurrencesRegexpr, substrRegexpr, locateRegexpr, curr_to_decfloat_amount, genericFunc);
54118
+ return (0, combi_1.altPrio)(substring, coalesce, tstmp_to_dats, concat, tstmp_to_tims, upper, lower, abs, ceil, floor, round, div, division, concat_with_space, dats_is_valid, tims_is_valid, dats_days_between, tstmp_add_seconds, tstmp_seconds_between, tstmp_current_utctimestamp, tstmp_is_valid, utcl_current, abap_system_timezone, abap_user_timezone, bintohex, hextobin, dats_add_days, dats_add_months, tstmp_to_dst, dats_tims_to_tstmp, mod, left, right, lpad, rpad, instr, length, ltrim, rtrim, replace, unitConversion, currencyConversion, decimalShift, fltp_to_dec, ratioOf, replaceRegexpr, matchesRegexpr, occurrencesRegexpr, substrRegexpr, locateRegexpr, curr_to_decfloat_amount, sqrt, genericFunc);
54057
54119
  }
54058
54120
  }
54059
54121
  exports.CDSFunction = CDSFunction;
@@ -54075,8 +54137,9 @@ const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index
54075
54137
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
54076
54138
  class CDSFunctionInput extends combi_1.Expression {
54077
54139
  getRunnable() {
54078
- const input = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSArithParen, _1.CDSAggregate, _1.CDSCast, _1.CDSFunction, _1.CDSCase, _1.CDSString, _1.CDSPrefixedName, _1.CDSInteger);
54079
- return input;
54140
+ const positional = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSArithParen, _1.CDSAggregate, _1.CDSCast, _1.CDSFunction, _1.CDSCase, _1.CDSString, _1.CDSPrefixedName, _1.CDSInteger);
54141
+ const named = (0, combi_1.seq)(_1.CDSName, "=", ">", positional);
54142
+ return (0, combi_1.altPrio)(named, positional);
54080
54143
  }
54081
54144
  }
54082
54145
  exports.CDSFunctionInput = CDSFunctionInput;
@@ -54205,10 +54268,14 @@ exports.CDSJoin = CDSJoin;
54205
54268
  Object.defineProperty(exports, "__esModule", ({ value: true }));
54206
54269
  exports.CDSName = void 0;
54207
54270
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
54271
+ const KEYWORDS = ["AS", "ON", "WHERE", "WITH", "UNION", "GROUP", "HAVING",
54272
+ "AND", "OR", "BETWEEN", "LIKE", "IN", "EXISTS",
54273
+ "WHEN", "THEN", "ELSE", "END", "CASE", "CAST"];
54208
54274
  class CDSName extends combi_1.Expression {
54209
54275
  getRunnable() {
54210
- const pre = (0, combi_1.seq)("/", (0, combi_1.regex)(/^[\w_]+$/), "/");
54211
- return (0, combi_1.altPrio)((0, combi_1.regex)(/^"(?:[^"]|"")*"$/), (0, combi_1.seq)((0, combi_1.optPrio)(":"), (0, combi_1.optPrio)(pre), (0, combi_1.regex)(/^\$?#?[\w_]+$/)));
54276
+ const word = (0, combi_1.regex)(/^\$?#?[\w_]+$/);
54277
+ const slashName = (0, combi_1.seq)("/", (0, combi_1.regex)(/^[\w]+$/), "/", (0, combi_1.stopBefore1)(...KEYWORDS), (0, combi_1.regex)(/^[\w_]+$/));
54278
+ return (0, combi_1.altPrio)((0, combi_1.regex)(/^"(?:[^"]|"")*"$/), (0, combi_1.seq)((0, combi_1.optPrio)(":"), slashName), (0, combi_1.seq)((0, combi_1.optPrio)(":"), word));
54212
54279
  }
54213
54280
  }
54214
54281
  exports.CDSName = CDSName;
@@ -54255,7 +54322,8 @@ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../cor
54255
54322
  class CDSParametersSelect extends combi_1.Expression {
54256
54323
  getRunnable() {
54257
54324
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
54258
- const value = (0, combi_1.alt)(_1.CDSInteger, name, _1.CDSString);
54325
+ const typedLiteral = (0, combi_1.seq)(_1.CDSType, _1.CDSString);
54326
+ const value = (0, combi_1.altPrio)(typedLiteral, _1.CDSInteger, name, _1.CDSString);
54259
54327
  const colonPair = (0, combi_1.seq)(name, ":", value, (0, combi_1.optPrio)("DEFAULT"));
54260
54328
  const arrowPair = (0, combi_1.seq)(name, "=", ">", value);
54261
54329
  const nameValue = (0, combi_1.altPrio)(colonPair, arrowPair);
@@ -54267,6 +54335,30 @@ exports.CDSParametersSelect = CDSParametersSelect;
54267
54335
 
54268
54336
  /***/ },
54269
54337
 
54338
+ /***/ "../core/build/src/cds/expressions/cds_paren_select.js"
54339
+ /*!*************************************************************!*\
54340
+ !*** ../core/build/src/cds/expressions/cds_paren_select.js ***!
54341
+ \*************************************************************/
54342
+ (__unused_webpack_module, exports, __webpack_require__) {
54343
+
54344
+ "use strict";
54345
+
54346
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
54347
+ exports.CDSParenSelect = void 0;
54348
+ const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index.js");
54349
+ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
54350
+ class CDSParenSelect extends combi_1.Expression {
54351
+ getRunnable() {
54352
+ const unionBranch = (0, combi_1.altPrio)(CDSParenSelect, _1.CDSSelect);
54353
+ const unionOps = (0, combi_1.star)((0, combi_1.altPrio)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), unionBranch), (0, combi_1.seq)("EXCEPT", unionBranch), (0, combi_1.seq)("INTERSECT", unionBranch)));
54354
+ return (0, combi_1.seq)("(", (0, combi_1.altPrio)((0, combi_1.seq)(CDSParenSelect, unionOps), (0, combi_1.seq)(_1.CDSSelect, unionOps)), ")");
54355
+ }
54356
+ }
54357
+ exports.CDSParenSelect = CDSParenSelect;
54358
+ //# sourceMappingURL=cds_paren_select.js.map
54359
+
54360
+ /***/ },
54361
+
54270
54362
  /***/ "../core/build/src/cds/expressions/cds_prefixed_name.js"
54271
54363
  /*!**************************************************************!*\
54272
54364
  !*** ../core/build/src/cds/expressions/cds_prefixed_name.js ***!
@@ -54279,10 +54371,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
54279
54371
  exports.CDSPrefixedName = void 0;
54280
54372
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
54281
54373
  const cds_name_1 = __webpack_require__(/*! ./cds_name */ "../core/build/src/cds/expressions/cds_name.js");
54374
+ const cds_integer_1 = __webpack_require__(/*! ./cds_integer */ "../core/build/src/cds/expressions/cds_integer.js");
54282
54375
  const cds_parameters_1 = __webpack_require__(/*! ./cds_parameters */ "../core/build/src/cds/expressions/cds_parameters.js");
54283
54376
  const cds_parameters_select_1 = __webpack_require__(/*! ./cds_parameters_select */ "../core/build/src/cds/expressions/cds_parameters_select.js");
54284
54377
  const cds_condition_1 = __webpack_require__(/*! ./cds_condition */ "../core/build/src/cds/expressions/cds_condition.js");
54285
- const cds_integer_1 = __webpack_require__(/*! ./cds_integer */ "../core/build/src/cds/expressions/cds_integer.js");
54286
54378
  const cds_string_1 = __webpack_require__(/*! ./cds_string */ "../core/build/src/cds/expressions/cds_string.js");
54287
54379
  class CDSPrefixedName extends combi_1.Expression {
54288
54380
  getRunnable() {
@@ -54292,13 +54384,17 @@ class CDSPrefixedName extends combi_1.Expression {
54292
54384
  const cardinalityJoin = (0, combi_1.seq)("[", cardSpec, ":", joinType, "]");
54293
54385
  const cardinalityJoinWhere = (0, combi_1.seq)("[", cardSpec, ":", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
54294
54386
  const joinWhere = (0, combi_1.seq)("[", joinType, "WHERE", cds_condition_1.CDSCondition, "]");
54295
- const textCard = (0, combi_1.altPrio)("MANY TO EXACT ONE", "MANY TO ONE", "ONE TO MANY", "ONE TO ONE", "TO EXACT ONE", "TO ONE", "TO MANY");
54387
+ const textCard = (0, combi_1.altPrio)("EXACT ONE TO EXACT ONE", "EXACT ONE TO MANY", "EXACT ONE TO ONE", "MANY TO EXACT ONE", "MANY TO MANY", "MANY TO ONE", "ONE TO EXACT ONE", "ONE TO MANY", "ONE TO ONE", "TO EXACT ONE", "TO ONE", "TO MANY");
54296
54388
  const textCardFilter = (0, combi_1.seq)("[", textCard, (0, combi_1.optPrio)((0, combi_1.seq)(":", (0, combi_1.altPrio)((0, combi_1.seq)(joinType, "WHERE", cds_condition_1.CDSCondition), joinType, cds_condition_1.CDSCondition))), "]");
54297
54389
  const cardNum = (0, combi_1.altPrio)(cds_integer_1.CDSInteger, "*");
54298
54390
  const rangeCard = (0, combi_1.seq)(cds_integer_1.CDSInteger, ".", ".", cardNum);
54299
54391
  const rangeCardFilter = (0, combi_1.seq)("[", rangeCard, ":", cds_condition_1.CDSCondition, "]");
54300
- const pathFilter = (0, combi_1.altPrio)(cardinalityJoinWhere, joinWhere, cardinalityJoin, joinRedirect, textCardFilter, rangeCardFilter, (0, combi_1.seq)("[", cardSpec, ":", cds_condition_1.CDSCondition, "]"), (0, combi_1.seq)("[", cds_condition_1.CDSCondition, "]"));
54301
- const segment = (0, combi_1.seq)(".", (0, combi_1.altPrio)(cds_string_1.CDSString, cds_name_1.CDSName, "*"), (0, combi_1.optPrio)((0, combi_1.altPrio)(cds_parameters_select_1.CDSParametersSelect, cds_parameters_1.CDSParameters)), (0, combi_1.optPrio)(pathFilter));
54392
+ const rangeOnly = (0, combi_1.seq)("[", rangeCard, "]");
54393
+ const numToText = (0, combi_1.seq)(cds_integer_1.CDSInteger, (0, combi_1.altPrio)("TO EXACT ONE", "TO ONE", "TO MANY"));
54394
+ const numTextCardFilter = (0, combi_1.seq)("[", numToText, (0, combi_1.optPrio)((0, combi_1.seq)(":", cds_condition_1.CDSCondition)), "]");
54395
+ const numToNum = (0, combi_1.seq)("[", cds_integer_1.CDSInteger, "TO", cds_integer_1.CDSInteger, (0, combi_1.optPrio)((0, combi_1.seq)(":", cds_condition_1.CDSCondition)), "]");
54396
+ const pathFilter = (0, combi_1.altPrio)(cardinalityJoinWhere, joinWhere, cardinalityJoin, joinRedirect, numToNum, numTextCardFilter, textCardFilter, rangeCardFilter, rangeOnly, (0, combi_1.seq)("[", cardSpec, ":", cds_condition_1.CDSCondition, "]"), (0, combi_1.seq)("[", cardSpec, "]"), (0, combi_1.seq)("[", cds_condition_1.CDSCondition, "]"));
54397
+ const segment = (0, combi_1.seq)(".", (0, combi_1.altPrio)(cds_string_1.CDSString, cds_integer_1.CDSInteger, cds_name_1.CDSName, "*"), (0, combi_1.optPrio)((0, combi_1.altPrio)(cds_parameters_select_1.CDSParametersSelect, cds_parameters_1.CDSParameters)), (0, combi_1.optPrio)(pathFilter));
54302
54398
  return (0, combi_1.seq)(cds_name_1.CDSName, (0, combi_1.optPrio)((0, combi_1.altPrio)(cds_parameters_1.CDSParameters, cds_parameters_select_1.CDSParametersSelect)), (0, combi_1.optPrio)(pathFilter), (0, combi_1.star)(segment));
54303
54399
  }
54304
54400
  }
@@ -54340,10 +54436,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
54340
54436
  exports.CDSRelation = void 0;
54341
54437
  const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index.js");
54342
54438
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
54439
+ const KEYWORDS = ["AS", "ON", "WHERE", "WITH", "UNION", "GROUP", "HAVING",
54440
+ "AND", "OR", "BETWEEN", "LIKE", "IN", "EXISTS",
54441
+ "WHEN", "THEN", "ELSE", "END", "CASE", "CAST"];
54343
54442
  class CDSRelation extends combi_1.Expression {
54344
54443
  getRunnable() {
54345
- const pre = (0, combi_1.seq)("/", (0, combi_1.regex)(/^[\w_]+$/), "/");
54346
- return (0, combi_1.seq)((0, combi_1.opt)(pre), (0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs));
54444
+ const word = (0, combi_1.regex)(/^[\w_]+$/);
54445
+ const slashName = (0, combi_1.seq)("/", (0, combi_1.regex)(/^[\w]+$/), "/", (0, combi_1.stopBefore1)(...KEYWORDS), (0, combi_1.regex)(/^[\w_]+$/));
54446
+ const name = (0, combi_1.altPrio)(slashName, word);
54447
+ return (0, combi_1.seq)(name, (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs));
54347
54448
  }
54348
54449
  }
54349
54450
  exports.CDSRelation = CDSRelation;
@@ -54367,11 +54468,12 @@ const cds_association_1 = __webpack_require__(/*! ./cds_association */ "../core/
54367
54468
  const cds_join_1 = __webpack_require__(/*! ./cds_join */ "../core/build/src/cds/expressions/cds_join.js");
54368
54469
  class CDSSelect extends combi_1.Expression {
54369
54470
  getRunnable() {
54370
- const fields = (0, combi_1.seq)((0, combi_1.star)((0, combi_1.seq)(_1.CDSElement, ",")), _1.CDSElement);
54471
+ const fields = (0, combi_1.seq)((0, combi_1.stopBefore1)("FROM"), (0, combi_1.star)((0, combi_1.seq)(_1.CDSElement, ",")), _1.CDSElement);
54371
54472
  const distinct = (0, combi_1.str)("DISTINCT");
54372
54473
  const elementList = (0, combi_1.seq)(_1.CDSElement, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.opt)(","));
54373
54474
  const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.altPrio)("*", elementList), (0, combi_1.str)("}"));
54374
- const aspectValue = (0, combi_1.altPrio)(_1.CDSString, _1.CDSPrefixedName);
54475
+ const typedLiteralVal = (0, combi_1.seq)(_1.CDSType, _1.CDSString);
54476
+ const aspectValue = (0, combi_1.altPrio)(typedLiteralVal, _1.CDSString, _1.CDSPrefixedName);
54375
54477
  const aspectBinding = (0, combi_1.seq)(_1.CDSPrefixedName, "=", ">", aspectValue);
54376
54478
  const bindAspect = (0, combi_1.seq)("BIND", "ASPECT", _1.CDSName, "(", aspectBinding, (0, combi_1.starPrio)((0, combi_1.seq)(",", aspectBinding)), ")", (0, combi_1.optPrio)((0, combi_1.seq)("AS", _1.CDSName)));
54377
54479
  const parenSelect = (0, combi_1.seq)("(", CDSSelect, ")");
@@ -54446,16 +54548,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
54446
54548
  exports.CDSTableField = void 0;
54447
54549
  const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index.js");
54448
54550
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
54449
- // A single field or association/composition inside a `define table entity { ... }`
54450
- // inline body. Wraps annotations + name + type together so tooling can iterate
54451
- // per-field with associated field-level annotations (matches the CDSElement
54452
- // shape used for select-list elements).
54453
54551
  class CDSTableField extends combi_1.Expression {
54454
54552
  getRunnable() {
54455
54553
  const nullability = (0, combi_1.optPrio)((0, combi_1.alt)("NOT NULL", "NULL"));
54554
+ const excludingNames = (0, combi_1.seq)(_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSName)));
54555
+ const excluding = (0, combi_1.seq)("EXCLUDING", "{", excludingNames, "}");
54556
+ const includeField = (0, combi_1.seq)("INCLUDE", _1.CDSPrefixedName, (0, combi_1.optPrio)((0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.str)("SIGNATURE ONLY"), (0, combi_1.optPrio)(excluding)), (0, combi_1.seq)(excluding, (0, combi_1.optPrio)((0, combi_1.str)("SIGNATURE ONLY"))))));
54456
54557
  const field = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.str)("KEY")), _1.CDSName, ":", _1.CDSType, nullability);
54457
54558
  const assocOrComp = (0, combi_1.seq)(_1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation));
54458
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.alt)(field, assocOrComp), ";");
54559
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.altPrio)(includeField, assocOrComp, field), ";");
54459
54560
  }
54460
54561
  }
54461
54562
  exports.CDSTableField = CDSTableField;
@@ -54522,7 +54623,9 @@ const _1 = __webpack_require__(/*! . */ "../core/build/src/cds/expressions/index
54522
54623
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
54523
54624
  class CDSWithParameters extends combi_1.Expression {
54524
54625
  getRunnable() {
54525
- const param = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", _1.CDSType, (0, combi_1.star)(_1.CDSAnnotation));
54626
+ const extNameValue = (0, combi_1.altPrio)(_1.CDSName, (0, combi_1.regex)(/^"(?:[^"]|"")*"$/));
54627
+ const externalName = (0, combi_1.seq)("EXTERNAL", "NAME", extNameValue);
54628
+ const param = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), _1.CDSName, ":", _1.CDSType, (0, combi_1.opt)(externalName), (0, combi_1.star)(_1.CDSAnnotation));
54526
54629
  return (0, combi_1.seq)("WITH PARAMETERS", param, (0, combi_1.star)((0, combi_1.seq)(",", param)));
54527
54630
  }
54528
54631
  }
@@ -54576,6 +54679,7 @@ __exportStar(__webpack_require__(/*! ./cds_define_hierarchy */ "../core/build/sr
54576
54679
  __exportStar(__webpack_require__(/*! ./cds_define_projection */ "../core/build/src/cds/expressions/cds_define_projection.js"), exports);
54577
54680
  __exportStar(__webpack_require__(/*! ./cds_define_table_entity */ "../core/build/src/cds/expressions/cds_define_table_entity.js"), exports);
54578
54681
  __exportStar(__webpack_require__(/*! ./cds_define_table_function */ "../core/build/src/cds/expressions/cds_define_table_function.js"), exports);
54682
+ __exportStar(__webpack_require__(/*! ./cds_paren_select */ "../core/build/src/cds/expressions/cds_paren_select.js"), exports);
54579
54683
  __exportStar(__webpack_require__(/*! ./cds_define_view */ "../core/build/src/cds/expressions/cds_define_view.js"), exports);
54580
54684
  __exportStar(__webpack_require__(/*! ./cds_element */ "../core/build/src/cds/expressions/cds_element.js"), exports);
54581
54685
  __exportStar(__webpack_require__(/*! ./cds_extend_view */ "../core/build/src/cds/expressions/cds_extend_view.js"), exports);
@@ -59512,10 +59616,10 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
59512
59616
  return undefined;
59513
59617
  }
59514
59618
  getMainABAPFile() {
59515
- // todo, uris, https://github.com/abaplint/abaplint/issues/673
59516
59619
  const search = this.getName().replace(/\//g, "#").toLowerCase() + "." + this.getType().toLowerCase() + ".abap";
59620
+ const encodedSearch = search.replace(/#/g, "%23");
59517
59621
  for (const file of this.getABAPFiles()) {
59518
- if (file.getFilename().endsWith(search)) {
59622
+ if (file.getFilename().endsWith(search) || file.getFilename().endsWith(encodedSearch)) {
59519
59623
  return file;
59520
59624
  }
59521
59625
  }
@@ -68939,7 +69043,7 @@ class Registry {
68939
69043
  }
68940
69044
  static abaplintVersion() {
68941
69045
  // magic, see build script "version.js"
68942
- return "2.120.2";
69046
+ return "2.120.4";
68943
69047
  }
68944
69048
  getDDICReferences() {
68945
69049
  return this.ddicReferences;
@@ -73650,39 +73754,6 @@ exports.ClassicExceptionsOverlap = ClassicExceptionsOverlap;
73650
73754
 
73651
73755
  "use strict";
73652
73756
 
73653
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
73654
- if (k2 === undefined) k2 = k;
73655
- var desc = Object.getOwnPropertyDescriptor(m, k);
73656
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
73657
- desc = { enumerable: true, get: function() { return m[k]; } };
73658
- }
73659
- Object.defineProperty(o, k2, desc);
73660
- }) : (function(o, m, k, k2) {
73661
- if (k2 === undefined) k2 = k;
73662
- o[k2] = m[k];
73663
- }));
73664
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
73665
- Object.defineProperty(o, "default", { enumerable: true, value: v });
73666
- }) : function(o, v) {
73667
- o["default"] = v;
73668
- });
73669
- var __importStar = (this && this.__importStar) || (function () {
73670
- var ownKeys = function(o) {
73671
- ownKeys = Object.getOwnPropertyNames || function (o) {
73672
- var ar = [];
73673
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
73674
- return ar;
73675
- };
73676
- return ownKeys(o);
73677
- };
73678
- return function (mod) {
73679
- if (mod && mod.__esModule) return mod;
73680
- var result = {};
73681
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
73682
- __setModuleDefault(result, mod);
73683
- return result;
73684
- };
73685
- })();
73686
73757
  Object.defineProperty(exports, "__esModule", ({ value: true }));
73687
73758
  exports.ClearExportingParameters = exports.ClearExportingParametersConf = void 0;
73688
73759
  const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
@@ -73691,12 +73762,11 @@ const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_i
73691
73762
  const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "../core/build/src/abap/5_syntax/syntax.js");
73692
73763
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "../core/build/src/objects/_abap_object.js");
73693
73764
  const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "../core/build/src/abap/5_syntax/_scope_type.js");
73765
+ const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
73694
73766
  const objects_1 = __webpack_require__(/*! ../objects */ "../core/build/src/objects/index.js");
73695
73767
  const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "../core/build/src/abap/5_syntax/_reference.js");
73696
73768
  const basic_1 = __webpack_require__(/*! ../abap/types/basic */ "../core/build/src/abap/types/basic/index.js");
73697
73769
  const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "../core/build/src/abap/2_statements/statements/_statement.js");
73698
- const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "../core/build/src/edit_helper.js");
73699
- const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
73700
73770
  class ClearExportingParametersConf extends _basic_rule_config_1.BasicRuleConfig {
73701
73771
  constructor() {
73702
73772
  super(...arguments);
@@ -73729,7 +73799,7 @@ Reading and writing the parameter in the same statement (e.g. "ev_result = ev_re
73729
73799
  as the source is evaluated before the parameter is assigned.
73730
73800
  Objects containing parser or syntax errors are not reported.
73731
73801
 
73732
- Only class and interface method implementations are checked, function module parameters are currently not supported.`,
73802
+ Class and interface method implementations and function modules are checked.`,
73733
73803
  tags: [_irule_1.RuleTag.Styleguide],
73734
73804
  badExample: `CLASS lcl DEFINITION.
73735
73805
  PUBLIC SECTION.
@@ -73785,19 +73855,20 @@ ENDCLASS.`,
73785
73855
  return issues;
73786
73856
  }
73787
73857
  traverse(node, obj, issues) {
73788
- if (node.getIdentifier().stype === _scope_type_1.ScopeType.Method) {
73789
- this.checkMethod(node, obj, issues);
73858
+ if (node.getIdentifier().stype === _scope_type_1.ScopeType.Method
73859
+ || node.getIdentifier().stype === _scope_type_1.ScopeType.FunctionModule) {
73860
+ this.checkProcedure(node, obj, issues);
73790
73861
  }
73791
73862
  for (const child of node.getChildren()) {
73792
73863
  this.traverse(child, obj, issues);
73793
73864
  }
73794
73865
  }
73795
- checkMethod(node, obj, issues) {
73796
- const parameters = this.findExportingByReference(node, obj);
73866
+ checkProcedure(node, obj, issues) {
73867
+ const references = this.collectReferences(node);
73868
+ const parameters = this.findExportingByReference(node, references);
73797
73869
  if (parameters.length === 0) {
73798
73870
  return;
73799
73871
  }
73800
- const references = this.collectReferences(node);
73801
73872
  for (const parameter of parameters) {
73802
73873
  const issue = this.checkParameter(parameter, references, obj);
73803
73874
  if (issue !== undefined) {
@@ -73805,52 +73876,36 @@ ENDCLASS.`,
73805
73876
  }
73806
73877
  }
73807
73878
  }
73808
- findExportingByReference(node, obj) {
73879
+ findExportingByReference(node, references) {
73809
73880
  var _a;
73810
73881
  const ret = [];
73811
- const vars = node.getData().vars;
73812
- for (const name in vars) {
73813
- const parameter = vars[name];
73882
+ const candidates = new Set(Object.values(node.getData().vars));
73883
+ for (const reference of references) {
73884
+ if (reference.resolved instanceof _typed_identifier_1.TypedIdentifier) {
73885
+ candidates.add(reference.resolved);
73886
+ }
73887
+ }
73888
+ for (const parameter of candidates) {
73814
73889
  const meta = parameter.getMeta();
73815
- if (meta.includes("exporting" /* IdentifierMeta.MethodExporting */) === false
73890
+ const exporting = meta.includes("exporting" /* IdentifierMeta.MethodExporting */)
73891
+ || meta.includes("function_module_exporting" /* IdentifierMeta.FunctionModuleExporting */);
73892
+ if (exporting === false
73816
73893
  || meta.includes("pass_by_value" /* IdentifierMeta.PassByValue */) === true) {
73817
73894
  continue;
73818
73895
  }
73819
- else if ((_a = this.conf.skipNames) === null || _a === void 0 ? void 0 : _a.some(s => s.toUpperCase() === name.toUpperCase())) {
73896
+ else if ((_a = this.conf.skipNames) === null || _a === void 0 ? void 0 : _a.some(s => s.toUpperCase() === parameter.getName().toUpperCase())) {
73820
73897
  continue;
73821
73898
  }
73822
73899
  const type = parameter.getType();
73823
73900
  if (type instanceof basic_1.VoidType || type instanceof basic_1.UnknownType) {
73824
73901
  continue; // e.g. RAP magic parameters, or unresolved types
73825
73902
  }
73826
- else if (this.isPassByValue(parameter, obj) === true) {
73827
- continue; // VALUE(..) parameters are always initialized
73828
- }
73829
73903
  ret.push(parameter);
73830
73904
  }
73831
73905
  return ret;
73832
73906
  }
73833
- isPassByValue(parameter, obj) {
73834
- var _a;
73835
- // the PassByValue meta is not set for EXPORTING parameters, so determine it from the definition
73836
- const file = obj.getABAPFileByName(parameter.getFilename());
73837
- if (file === undefined) {
73838
- return false;
73839
- }
73840
- const statement = edit_helper_1.EditHelper.findStatement(parameter.getToken(), file);
73841
- if (statement === undefined) {
73842
- return false;
73843
- }
73844
- for (const param of statement.findAllExpressions(Expressions.MethodParam)) {
73845
- const nameToken = (_a = param.findFirstExpression(Expressions.MethodParamName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
73846
- if (nameToken !== undefined && nameToken.getStart().equals(parameter.getStart())) {
73847
- return param.getFirstToken().getStr().toUpperCase() === "VALUE";
73848
- }
73849
- }
73850
- return false;
73851
- }
73852
73907
  collectReferences(node) {
73853
- // methods do not nest, so all descendant scopes (FOR, LET, ...) belong to this method
73908
+ // procedures do not nest, so all descendant scopes (FOR, LET, ...) belong to this procedure
73854
73909
  const ret = [...node.getData().references];
73855
73910
  for (const child of node.getChildren()) {
73856
73911
  ret.push(...this.collectReferences(child));
@@ -73861,7 +73916,9 @@ ENDCLASS.`,
73861
73916
  let firstRead = undefined;
73862
73917
  let earliestWrite = undefined;
73863
73918
  for (const reference of references) {
73864
- if (reference.resolved === undefined || parameter.equals(reference.resolved) === false) {
73919
+ if (reference.resolved === undefined
73920
+ || parameter.equals(reference.resolved) === false
73921
+ || parameter.getName().toUpperCase() !== reference.resolved.getName().toUpperCase()) {
73865
73922
  continue;
73866
73923
  }
73867
73924
  const pos = reference.position.getStart();
@@ -93063,7 +93120,8 @@ ENDCLASS.`,
93063
93120
  }
93064
93121
  for (const v in vars) {
93065
93122
  const id = vars[v];
93066
- if (id.getMeta().includes("pass_by_value" /* IdentifierMeta.PassByValue */) === false) {
93123
+ if (id.getMeta().includes("importing" /* IdentifierMeta.MethodImporting */) === false
93124
+ || id.getMeta().includes("pass_by_value" /* IdentifierMeta.PassByValue */) === false) {
93067
93125
  continue;
93068
93126
  }
93069
93127
  else if (this.reg.isFileDependency(id.getFilename()) === true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.2",
3
+ "version": "2.120.4",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.120.2",
42
+ "@abaplint/core": "^2.120.4",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",