@abaplint/core 2.95.41 → 2.95.42

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.
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.95.41";
66
+ return "2.95.42";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -182,6 +182,19 @@ Only one transformation is applied to a statement at a time, so multiple steps m
182
182
  }
183
183
  return this.graph.listMainForInclude(filename);
184
184
  }
185
+ containsError(highObj) {
186
+ for (const file of highObj.getABAPFiles()) {
187
+ for (const statement of file.getStatements()) {
188
+ if (statement.get() instanceof _statement_1.Unknown) {
189
+ return true; // contains parser errors
190
+ }
191
+ }
192
+ if (file.getStructure() === undefined) {
193
+ return true;
194
+ }
195
+ }
196
+ return false;
197
+ }
185
198
  run(lowObj) {
186
199
  var _a;
187
200
  const ret = [];
@@ -198,6 +211,9 @@ Only one transformation is applied to a statement at a time, so multiple steps m
198
211
  return ret;
199
212
  }
200
213
  let highSyntaxObj = highObj;
214
+ if (this.containsError(highObj)) {
215
+ return ret;
216
+ }
201
217
  // for includes do the syntax check via a main program
202
218
  if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {
203
219
  const mains = this.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());
@@ -2395,6 +2411,11 @@ ${indentation} output = ${topTarget}.`;
2395
2411
  if (chain === undefined) {
2396
2412
  continue;
2397
2413
  }
2414
+ const concat = chain.concatTokens().toUpperCase();
2415
+ if (concat.startsWith("LINE_EXISTS( ") || concat.startsWith("LINE_INDEX( ")) {
2416
+ // these are handled separately
2417
+ continue;
2418
+ }
2398
2419
  let predicate = false;
2399
2420
  const spag = highSyntax.spaghetti.lookupPosition(high.getFirstToken().getStart(), lowFile.getFilename());
2400
2421
  for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {
@@ -2526,11 +2547,12 @@ ${indentation} output = ${topTarget}.`;
2526
2547
  return undefined;
2527
2548
  }
2528
2549
  findStartOfIf(node, highFile) {
2529
- var _a;
2530
2550
  const structure = highFile.getStructure();
2531
2551
  for (const c of (structure === null || structure === void 0 ? void 0 : structure.findAllStructuresRecursive(Structures.If)) || []) {
2532
- if (((_a = c.findDirectStructure(Structures.ElseIf)) === null || _a === void 0 ? void 0 : _a.getFirstStatement()) === node) {
2533
- return c.getFirstToken().getStart();
2552
+ for (const ei of c.findDirectStructures(Structures.ElseIf)) {
2553
+ if (ei.getFirstStatement() === node) {
2554
+ return c.getFirstToken().getStart();
2555
+ }
2534
2556
  }
2535
2557
  }
2536
2558
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.95.41",
3
+ "version": "2.95.42",
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
  "@microsoft/api-extractor": "^7.34.4",
51
51
  "@types/chai": "^4.3.4",
52
52
  "@types/mocha": "^10.0.1",
53
- "@types/node": "^18.15.0",
53
+ "@types/node": "^18.15.1",
54
54
  "chai": "^4.3.7",
55
55
  "eslint": "^8.36.0",
56
56
  "mocha": "^10.2.0",