@abaplint/core 2.85.51 → 2.85.52
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 +14 -6
- package/package.json +1 -1
package/build/src/registry.js
CHANGED
|
@@ -920,15 +920,23 @@ ${indentation} output = ${topTarget}.`;
|
|
|
920
920
|
return { body, end };
|
|
921
921
|
}
|
|
922
922
|
outlineSwitch(node, lowFile, highSyntax) {
|
|
923
|
-
var _a, _b;
|
|
923
|
+
var _a, _b, _c;
|
|
924
924
|
for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {
|
|
925
925
|
const firstToken = i.getFirstToken();
|
|
926
926
|
if (firstToken.getStr().toUpperCase() !== "SWITCH") {
|
|
927
927
|
continue;
|
|
928
928
|
}
|
|
929
|
-
|
|
929
|
+
let type = this.findType(i, lowFile, highSyntax);
|
|
930
930
|
if (type === undefined) {
|
|
931
|
-
|
|
931
|
+
if (node.get() instanceof Statements.Move && node.findDirectExpression(Expressions.Source) === i) {
|
|
932
|
+
type = "LIKE " + ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());
|
|
933
|
+
}
|
|
934
|
+
if (type === undefined) {
|
|
935
|
+
continue;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
else {
|
|
939
|
+
type = "TYPE " + type;
|
|
932
940
|
}
|
|
933
941
|
const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);
|
|
934
942
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
@@ -938,11 +946,11 @@ ${indentation} output = ${topTarget}.`;
|
|
|
938
946
|
if (switchBody === undefined) {
|
|
939
947
|
continue;
|
|
940
948
|
}
|
|
941
|
-
for (const l of ((
|
|
949
|
+
for (const l of ((_b = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _b === void 0 ? void 0 : _b.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {
|
|
942
950
|
name = l.getFirstToken().getStr();
|
|
943
|
-
body += indentation + `DATA(${name}) = ${(
|
|
951
|
+
body += indentation + `DATA(${name}) = ${(_c = switchBody.findFirstExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens()}.\n`;
|
|
944
952
|
}
|
|
945
|
-
body += `DATA ${uniqueName}
|
|
953
|
+
body += `DATA ${uniqueName} ${type}.\n`;
|
|
946
954
|
let firstSource = false;
|
|
947
955
|
let inWhen = false;
|
|
948
956
|
for (const c of switchBody.getChildren()) {
|