@abaplint/cli 2.102.53 → 2.102.54

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 +47 -14
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -23844,20 +23844,30 @@ const source_field_symbol_1 = __webpack_require__(/*! ./source_field_symbol */ "
23844
23844
  const source_field_1 = __webpack_require__(/*! ./source_field */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source_field.js");
23845
23845
  class FieldChain {
23846
23846
  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);
23847
+ var _a, _b, _c, _d, _e;
23848
+ const children = node.getChildren().slice();
23849
+ let contextName = children[0].concatTokens();
23850
+ let context = undefined;
23851
+ try {
23852
+ context = this.findTop(children.shift(), scope, filename, refType);
23853
+ }
23854
+ catch (error) {
23855
+ const concat = node.concatTokens();
23856
+ if (concat.includes("-") && ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SourceField) {
23857
+ // workaround for names with dashes, eg. "sy-repid"
23858
+ const offset = ((_b = node.findDirectExpression(Expressions.FieldOffset)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
23859
+ const length = ((_c = node.findDirectExpression(Expressions.FieldLength)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "";
23860
+ const found = scope.findVariable(concat.replace(offset, "").replace(length, ""));
23861
+ if (found) {
23862
+ if (refType) {
23863
+ scope.addReference(node.getFirstToken(), found, refType, filename);
23864
+ }
23865
+ // this is not completely correct, but will work, dashes in names is a mess anyhow
23866
+ return found.getType();
23854
23867
  }
23855
- return found.getType();
23856
23868
  }
23869
+ throw error;
23857
23870
  }
23858
- const children = node.getChildren().slice();
23859
- let contextName = children[0].concatTokens();
23860
- let context = this.findTop(children.shift(), scope, filename, refType);
23861
23871
  while (children.length > 0) {
23862
23872
  contextName += children[0].concatTokens();
23863
23873
  const current = children.shift();
@@ -23905,7 +23915,30 @@ class FieldChain {
23905
23915
  if (context instanceof basic_1.TableType && context.isWithHeader()) {
23906
23916
  context = context.getRowType();
23907
23917
  }
23908
- context = new component_name_1.ComponentName().runSyntax(context, current);
23918
+ try {
23919
+ context = new component_name_1.ComponentName().runSyntax(context, current);
23920
+ }
23921
+ catch (error) {
23922
+ const concat = node.concatTokens();
23923
+ if (concat.includes("-")) {
23924
+ // workaround for names with dashes, eg. "sy-repid"
23925
+ const offset = ((_d = node.findDirectExpression(Expressions.FieldOffset)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || "";
23926
+ const length = ((_e = node.findDirectExpression(Expressions.FieldLength)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || "";
23927
+ const found = scope.findVariable(concat.replace(offset, "").replace(length, ""));
23928
+ if (found) {
23929
+ if (refType) {
23930
+ scope.addReference(node.getFirstToken(), found, refType, filename);
23931
+ }
23932
+ context = found.getType();
23933
+ }
23934
+ else {
23935
+ throw error;
23936
+ }
23937
+ }
23938
+ else {
23939
+ throw error;
23940
+ }
23941
+ }
23909
23942
  }
23910
23943
  else if (current instanceof nodes_1.ExpressionNode
23911
23944
  && current.get() instanceof Expressions.TableExpression) {
@@ -49149,7 +49182,7 @@ class Registry {
49149
49182
  }
49150
49183
  static abaplintVersion() {
49151
49184
  // magic, see build script "version.sh"
49152
- return "2.102.53";
49185
+ return "2.102.54";
49153
49186
  }
49154
49187
  getDDICReferences() {
49155
49188
  return this.ddicReferences;
@@ -71780,7 +71813,7 @@ Builder.prototype.j2x = function(jObj, level) {
71780
71813
  let attrStr = '';
71781
71814
  let val = '';
71782
71815
  for (let key in jObj) {
71783
- if(!jObj.hasOwnProperty(key)) continue;
71816
+ if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
71784
71817
  if (typeof jObj[key] === 'undefined') {
71785
71818
  // supress undefined node only if it is not an attribute
71786
71819
  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.54",
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.54",
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",