@abaplint/core 2.102.8 → 2.102.9
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.
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +19 -5
- package/package.json +1 -1
package/build/src/registry.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
333
|
+
return found;
|
|
334
334
|
}
|
|
335
|
-
|
|
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
|
-
|
|
2574
|
+
let source = undefined;
|
|
2575
|
+
for (const s of node.findAllExpressions(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
|
}
|