@abaplint/core 2.111.0 → 2.111.1

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.
@@ -24,7 +24,7 @@ class ComponentCompareSimple {
24
24
  }
25
25
  }
26
26
  else {
27
- throw "ComponentCompareSimple, unexpected node";
27
+ throw new Error("ComponentCompareSimple, unexpected node");
28
28
  }
29
29
  }
30
30
  }
@@ -4,12 +4,18 @@ exports.Default = void 0;
4
4
  const Expressions = require("../../2_statements/expressions");
5
5
  const field_chain_1 = require("./field_chain");
6
6
  const _reference_1 = require("../_reference");
7
+ const constant_1 = require("./constant");
7
8
  class Default {
8
9
  runSyntax(node, scope, filename) {
9
10
  const chain = node.findDirectExpression(Expressions.FieldChain);
10
11
  if (chain) {
11
- new field_chain_1.FieldChain().runSyntax(chain, scope, filename, _reference_1.ReferenceType.DataReadReference);
12
+ return new field_chain_1.FieldChain().runSyntax(chain, scope, filename, _reference_1.ReferenceType.DataReadReference);
12
13
  }
14
+ const constant = node.findDirectExpression(Expressions.Constant);
15
+ if (constant) {
16
+ return new constant_1.Constant().runSyntax(constant);
17
+ }
18
+ return undefined;
13
19
  }
14
20
  }
15
21
  exports.Default = Default;
@@ -17,29 +17,25 @@ const source_field_symbol_1 = require("./source_field_symbol");
17
17
  const source_field_1 = require("./source_field");
18
18
  class FieldChain {
19
19
  runSyntax(node, scope, filename, refType) {
20
- var _a, _b, _c, _d, _e;
21
- const children = node.getChildren();
22
- let context = undefined;
23
- try {
24
- context = this.findTop(children[0], scope, filename, refType);
25
- }
26
- catch (error) {
20
+ var _a, _b, _c;
21
+ if (((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SourceField
22
+ && node.findDirectExpression(Expressions.ComponentName)) {
23
+ // workaround for names with dashes, eg. "sy-repid"
27
24
  const concat = node.concatTokens();
28
- if (concat.includes("-") && ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SourceField) {
29
- // workaround for names with dashes, eg. "sy-repid"
30
- const offset = ((_b = node.findDirectExpression(Expressions.FieldOffset)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
31
- const length = ((_c = node.findDirectExpression(Expressions.FieldLength)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "";
32
- const found = scope.findVariable(concat.replace(offset, "").replace(length, ""));
33
- if (found) {
34
- if (refType) {
35
- scope.addReference(node.getFirstToken(), found, refType, filename);
36
- }
37
- // this is not completely correct, but will work, dashes in names is a mess anyhow
38
- return found.getType();
25
+ const offset = ((_b = node.findDirectExpression(Expressions.FieldOffset)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
26
+ const length = ((_c = node.findDirectExpression(Expressions.FieldLength)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "";
27
+ const found = scope.findVariable(concat.replace(offset, "").replace(length, ""));
28
+ if (found) {
29
+ if (refType) {
30
+ scope.addReference(node.getFirstToken(), found, refType, filename);
39
31
  }
32
+ // this is not completely correct, but will work, dashes in names is a mess anyhow
33
+ return found.getType();
40
34
  }
41
- throw error;
42
35
  }
36
+ let context = undefined;
37
+ const children = node.getChildren();
38
+ context = this.findTop(children[0], scope, filename, refType);
43
39
  for (let i = 1; i < children.length; i++) {
44
40
  const current = children[i];
45
41
  if (current === undefined) {
@@ -90,30 +86,7 @@ class FieldChain {
90
86
  if (context instanceof basic_1.TableType && context.isWithHeader()) {
91
87
  context = context.getRowType();
92
88
  }
93
- try {
94
- context = new component_name_1.ComponentName().runSyntax(context, current);
95
- }
96
- catch (error) {
97
- const concat = node.concatTokens();
98
- if (concat.includes("-")) {
99
- // workaround for names with dashes, eg. "sy-repid"
100
- const offset = ((_d = node.findDirectExpression(Expressions.FieldOffset)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || "";
101
- const length = ((_e = node.findDirectExpression(Expressions.FieldLength)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || "";
102
- const found = scope.findVariable(concat.replace(offset, "").replace(length, ""));
103
- if (found) {
104
- if (refType) {
105
- scope.addReference(node.getFirstToken(), found, refType, filename);
106
- }
107
- context = found.getType();
108
- }
109
- else {
110
- throw error;
111
- }
112
- }
113
- else {
114
- throw error;
115
- }
116
- }
89
+ context = new component_name_1.ComponentName().runSyntax(context, current);
117
90
  }
118
91
  else if (current instanceof nodes_1.ExpressionNode
119
92
  && current.get() instanceof Expressions.TableExpression) {
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.111.0";
70
+ return "2.111.1";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.111.0",
3
+ "version": "2.111.1",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "homepage": "https://abaplint.org",
52
52
  "devDependencies": {
53
- "@microsoft/api-extractor": "^7.47.0",
53
+ "@microsoft/api-extractor": "^7.47.1",
54
54
  "@types/chai": "^4.3.16",
55
55
  "@types/mocha": "^10.0.7",
56
56
  "@types/node": "^20.14.10",