@abaplint/core 2.102.8 → 2.102.10

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.
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.102.8";
68
+ return "2.102.10";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
@@ -287,13 +287,12 @@ Make sure to test the downported code, it might not always be completely correct
287
287
  }
288
288
  }
289
289
  }
290
- else if (ret.length === 0 && / xsdbool\(/i.test(lowFile.getRaw())) {
290
+ if (ret.length === 0 && lowFile.getRaw().includes(" xsdbool( ")) {
291
291
  for (let i = 0; i < lowStatements.length; i++) {
292
292
  const high = highStatements[i];
293
293
  const issue = this.replaceXsdBool(high, lowFile, highSyntax);
294
294
  if (issue) {
295
295
  ret.push(issue);
296
- break;
297
296
  }
298
297
  }
299
298
  }
@@ -328,11 +327,13 @@ Make sure to test the downported code, it might not always be completely correct
328
327
  return undefined;
329
328
  }
330
329
  // downport XSDBOOL() early, as it is valid 702 syntax
330
+ /*
331
331
  let found = this.replaceXsdBool(high, lowFile, highSyntax);
332
332
  if (found) {
333
- return found;
333
+ return found;
334
334
  }
335
- found = this.downportEnum(low, high, lowFile, highSyntax, highFile);
335
+ */
336
+ let found = this.downportEnum(low, high, lowFile, highSyntax, highFile);
336
337
  if (found) {
337
338
  return found;
338
339
  }
@@ -2570,7 +2571,20 @@ ${indentation} output = ${uniqueName}.\n`;
2570
2571
  if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference
2571
2572
  && r.position.getName().toUpperCase() === "XSDBOOL") {
2572
2573
  const token = r.position.getToken();
2573
- const fix = edit_helper_1.EditHelper.replaceRange(lowFile, token.getStart(), token.getEnd(), "boolc");
2574
+ let source = undefined;
2575
+ for (const s of node.findAllExpressionsRecursive(Expressions.Source)) {
2576
+ if (s.getFirstToken().getStart().equals(token.getStart())) {
2577
+ source = s;
2578
+ break;
2579
+ }
2580
+ }
2581
+ const children = source === null || source === void 0 ? void 0 : source.getChildren();
2582
+ if (source === undefined || (children === null || children === void 0 ? void 0 : children.length) !== 4) {
2583
+ continue;
2584
+ }
2585
+ // make sure to convert to the correct type, RTTI might be used on the result of XSDBOOL
2586
+ const code = "CONV xsdboolean( boolc( " + children[2].concatTokens() + " ) )";
2587
+ const fix = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), code);
2574
2588
  return issue_1.Issue.atToken(lowFile, token, "Use BOOLC", this.getMetadata().key, this.conf.severity, fix);
2575
2589
  }
2576
2590
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.102.8",
3
+ "version": "2.102.10",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",