@abaplint/cli 2.102.53 → 2.102.55

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 +53 -14
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -1467,6 +1467,11 @@ class Lexer {
1467
1467
  this.add();
1468
1468
  this.m = this.ModeNormal;
1469
1469
  }
1470
+ else if (this.m === this.ModeTemplate
1471
+ && ahead === "}"
1472
+ && current !== "\\") {
1473
+ this.add();
1474
+ }
1470
1475
  else if (this.m === this.ModeStr
1471
1476
  && current === "'"
1472
1477
  && buf.length > 1
@@ -23844,20 +23849,30 @@ const source_field_symbol_1 = __webpack_require__(/*! ./source_field_symbol */ "
23844
23849
  const source_field_1 = __webpack_require__(/*! ./source_field */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source_field.js");
23845
23850
  class FieldChain {
23846
23851
  runSyntax(node, scope, filename, refType) {
23847
- const concat = node.concatTokens();
23848
- if (concat.includes("-")) {
23849
- // workaround for names with dashes
23850
- const found = scope.findVariable(concat);
23851
- if (found) {
23852
- if (refType) {
23853
- scope.addReference(node.getFirstToken(), found, refType, filename);
23852
+ var _a, _b, _c, _d, _e;
23853
+ const children = node.getChildren().slice();
23854
+ let contextName = children[0].concatTokens();
23855
+ let context = undefined;
23856
+ try {
23857
+ context = this.findTop(children.shift(), scope, filename, refType);
23858
+ }
23859
+ catch (error) {
23860
+ const concat = node.concatTokens();
23861
+ if (concat.includes("-") && ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SourceField) {
23862
+ // workaround for names with dashes, eg. "sy-repid"
23863
+ const offset = ((_b = node.findDirectExpression(Expressions.FieldOffset)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
23864
+ const length = ((_c = node.findDirectExpression(Expressions.FieldLength)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "";
23865
+ const found = scope.findVariable(concat.replace(offset, "").replace(length, ""));
23866
+ if (found) {
23867
+ if (refType) {
23868
+ scope.addReference(node.getFirstToken(), found, refType, filename);
23869
+ }
23870
+ // this is not completely correct, but will work, dashes in names is a mess anyhow
23871
+ return found.getType();
23854
23872
  }
23855
- return found.getType();
23856
23873
  }
23874
+ throw error;
23857
23875
  }
23858
- const children = node.getChildren().slice();
23859
- let contextName = children[0].concatTokens();
23860
- let context = this.findTop(children.shift(), scope, filename, refType);
23861
23876
  while (children.length > 0) {
23862
23877
  contextName += children[0].concatTokens();
23863
23878
  const current = children.shift();
@@ -23905,7 +23920,30 @@ class FieldChain {
23905
23920
  if (context instanceof basic_1.TableType && context.isWithHeader()) {
23906
23921
  context = context.getRowType();
23907
23922
  }
23908
- context = new component_name_1.ComponentName().runSyntax(context, current);
23923
+ try {
23924
+ context = new component_name_1.ComponentName().runSyntax(context, current);
23925
+ }
23926
+ catch (error) {
23927
+ const concat = node.concatTokens();
23928
+ if (concat.includes("-")) {
23929
+ // workaround for names with dashes, eg. "sy-repid"
23930
+ const offset = ((_d = node.findDirectExpression(Expressions.FieldOffset)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || "";
23931
+ const length = ((_e = node.findDirectExpression(Expressions.FieldLength)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || "";
23932
+ const found = scope.findVariable(concat.replace(offset, "").replace(length, ""));
23933
+ if (found) {
23934
+ if (refType) {
23935
+ scope.addReference(node.getFirstToken(), found, refType, filename);
23936
+ }
23937
+ context = found.getType();
23938
+ }
23939
+ else {
23940
+ throw error;
23941
+ }
23942
+ }
23943
+ else {
23944
+ throw error;
23945
+ }
23946
+ }
23909
23947
  }
23910
23948
  else if (current instanceof nodes_1.ExpressionNode
23911
23949
  && current.get() instanceof Expressions.TableExpression) {
@@ -49149,7 +49187,7 @@ class Registry {
49149
49187
  }
49150
49188
  static abaplintVersion() {
49151
49189
  // magic, see build script "version.sh"
49152
- return "2.102.53";
49190
+ return "2.102.55";
49153
49191
  }
49154
49192
  getDDICReferences() {
49155
49193
  return this.ddicReferences;
@@ -68552,6 +68590,7 @@ class UnreachableCode extends _abap_rule_1.ABAPRule {
68552
68590
  || s instanceof Statements.EndMethod
68553
68591
  || s instanceof Statements.EndModule
68554
68592
  || s instanceof Statements.EndForm
68593
+ || s instanceof Statements.EndTestSeam
68555
68594
  || s instanceof Statements.EndAt
68556
68595
  || s instanceof Statements.EndSelect
68557
68596
  || s instanceof Statements.AtSelectionScreen
@@ -71780,7 +71819,7 @@ Builder.prototype.j2x = function(jObj, level) {
71780
71819
  let attrStr = '';
71781
71820
  let val = '';
71782
71821
  for (let key in jObj) {
71783
- if(!jObj.hasOwnProperty(key)) continue;
71822
+ if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
71784
71823
  if (typeof jObj[key] === 'undefined') {
71785
71824
  // supress undefined node only if it is not an attribute
71786
71825
  if (this.isAttribute(key)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.102.53",
3
+ "version": "2.102.55",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,12 +38,12 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.102.53",
41
+ "@abaplint/core": "^2.102.55",
42
42
  "@types/chai": "^4.3.6",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.3",
45
45
  "@types/mocha": "^10.0.2",
46
- "@types/node": "^20.8.0",
46
+ "@types/node": "^20.8.2",
47
47
  "@types/progress": "^2.0.5",
48
48
  "chai": "^4.3.10",
49
49
  "chalk": "^5.3.0",