@abaplint/cli 2.113.216 → 2.113.217

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 +40 -9
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -4107,7 +4107,7 @@ exports.AssociationName = void 0;
4107
4107
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
4108
4108
  class AssociationName extends combi_1.Expression {
4109
4109
  getRunnable() {
4110
- return (0, combi_1.regex)(/^\\_[\w]+$/);
4110
+ return (0, combi_1.regex)(/^(\\_[\w]+)+$/);
4111
4111
  }
4112
4112
  }
4113
4113
  exports.AssociationName = AssociationName;
@@ -25959,8 +25959,10 @@ class FieldChain {
25959
25959
  }
25960
25960
  else if (current.get() instanceof tokens_1.Dash) {
25961
25961
  if (context instanceof basic_1.UnknownType) {
25962
+ /*
25962
25963
  const message = "Not a structure, type unknown, FieldChain";
25963
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, current.getFirstToken(), message));
25964
+ input.issues.push(syntaxIssue(input, current.getFirstToken(), message));
25965
+ */
25964
25966
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
25965
25967
  }
25966
25968
  else if (!(context instanceof basic_1.StructureType)
@@ -32731,9 +32733,10 @@ const component_cond_1 = __webpack_require__(/*! ../expressions/component_cond *
32731
32733
  const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
32732
32734
  const loop_group_by_1 = __webpack_require__(/*! ../expressions/loop_group_by */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js");
32733
32735
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
32736
+ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
32734
32737
  class Loop {
32735
32738
  runSyntax(node, input) {
32736
- var _a;
32739
+ var _a, _b;
32737
32740
  const loopTarget = node.findDirectExpression(Expressions.LoopTarget);
32738
32741
  let target = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.Target);
32739
32742
  const targetType = target ? target_1.Target.runSyntax(target, input) : undefined;
@@ -32783,6 +32786,7 @@ class Loop {
32783
32786
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
32784
32787
  }
32785
32788
  const targetConcat = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.concatTokens().toUpperCase();
32789
+ const topType = sourceType; // todo: refactor topType vs sourceType vs rowType
32786
32790
  if (sourceType instanceof basic_1.TableType) {
32787
32791
  rowType = sourceType.getRowType();
32788
32792
  sourceType = rowType;
@@ -32790,6 +32794,10 @@ class Loop {
32790
32794
  sourceType = new basic_1.DataReference(sourceType);
32791
32795
  }
32792
32796
  }
32797
+ const cond = node.findDirectExpression(Expressions.ComponentCond);
32798
+ if (cond !== undefined) {
32799
+ component_cond_1.ComponentCond.runSyntax(cond, input, rowType);
32800
+ }
32793
32801
  if (targetConcat
32794
32802
  && targetConcat.startsWith("TRANSPORTING ")
32795
32803
  && node.findDirectTokenByText("WHERE") === undefined) {
@@ -32797,6 +32805,32 @@ class Loop {
32797
32805
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
32798
32806
  return;
32799
32807
  }
32808
+ if (node.findDirectTokenByText("USING") !== undefined
32809
+ && cond !== undefined
32810
+ && topType instanceof basic_1.TableType) {
32811
+ // https://github.com/abap2xlsx/abap2xlsx/issues/1341
32812
+ const keyName = node.findExpressionAfterToken("KEY");
32813
+ let key = undefined;
32814
+ if ((keyName === null || keyName === void 0 ? void 0 : keyName.get()) instanceof Expressions.SimpleName) {
32815
+ // it might be dynamic, in that case we cannot check anything
32816
+ key = (_b = topType.getOptions().secondary) === null || _b === void 0 ? void 0 : _b.find(k => k.name.toUpperCase() === keyName.getFirstToken().getStr().toUpperCase());
32817
+ if (key === undefined) {
32818
+ const message = "Key " + (keyName === null || keyName === void 0 ? void 0 : keyName.concatTokens()) + " not found in table type";
32819
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
32820
+ return;
32821
+ }
32822
+ if (input.scope.getRegistry().getConfig().getVersion() <= version_1.Version.v740sp02) {
32823
+ const compares = cond.findAllExpressionsRecursive(Expressions.ComponentCompare).map(c => c.concatTokens().toUpperCase());
32824
+ for (const keyField of key.keyFields) {
32825
+ if (compares.find(c => c === keyField.toUpperCase() + " IS INITIAL") !== undefined) {
32826
+ const message = "Loop, key check with IS INITIAL cannot optimized before 7.40 SP02";
32827
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
32828
+ return;
32829
+ }
32830
+ }
32831
+ }
32832
+ }
32833
+ }
32800
32834
  const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);
32801
32835
  if (inline) {
32802
32836
  inline_data_1.InlineData.runSyntax(inline, input, sourceType);
@@ -32817,9 +32851,6 @@ class Loop {
32817
32851
  fstarget_1.FSTarget.runSyntax(fstarget, input, sourceType);
32818
32852
  }
32819
32853
  }
32820
- for (const t of node.findDirectExpressions(Expressions.ComponentCond)) {
32821
- component_cond_1.ComponentCond.runSyntax(t, input, rowType);
32822
- }
32823
32854
  for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
32824
32855
  dynamic_1.Dynamic.runSyntax(t, input);
32825
32856
  }
@@ -41212,7 +41243,7 @@ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node
41212
41243
  class CDSCase extends combi_1.Expression {
41213
41244
  getRunnable() {
41214
41245
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(".", _1.CDSName)));
41215
- const value = (0, combi_1.altPrio)(_1.CDSFunction, _1.CDSString, CDSCase, _1.CDSCast, _1.CDSArithmetics, name);
41246
+ const value = (0, combi_1.altPrio)(_1.CDSString, CDSCase, _1.CDSCast, _1.CDSArithmetics, _1.CDSFunction, name);
41216
41247
  const thenValue = (0, combi_1.altPrio)((0, combi_1.seq)("(", value, ")"), value);
41217
41248
  const simple = (0, combi_1.seq)((0, combi_1.altPrio)(_1.CDSFunction, name), (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", value, "THEN", thenValue)));
41218
41249
  const complex = (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", _1.CDSCondition, "THEN", thenValue));
@@ -41343,7 +41374,7 @@ class CDSDefineCustom extends combi_1.Expression {
41343
41374
  getRunnable() {
41344
41375
  const field = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.str)("KEY")), cds_name_1.CDSName, ":", cds_type_1.CDSType, ";");
41345
41376
  const compsiOrAssoci = (0, combi_1.seq)(cds_name_1.CDSName, ":", (0, combi_1.alt)(_1.CDSComposition, _1.CDSAssociation), ";");
41346
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("DEFINE"), (0, combi_1.opt)((0, combi_1.str)("ROOT")), (0, combi_1.str)("CUSTOM ENTITY"), (0, combi_1.opt)(_1.CDSWithParameters), cds_name_1.CDSName, (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)(";"));
41377
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (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)(";"));
41347
41378
  }
41348
41379
  }
41349
41380
  exports.CDSDefineCustom = CDSDefineCustom;
@@ -54518,7 +54549,7 @@ class Registry {
54518
54549
  }
54519
54550
  static abaplintVersion() {
54520
54551
  // magic, see build script "version.sh"
54521
- return "2.113.216";
54552
+ return "2.113.217";
54522
54553
  }
54523
54554
  getDDICReferences() {
54524
54555
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.216",
3
+ "version": "2.113.217",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.113.216",
41
+ "@abaplint/core": "^2.113.217",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",