@abaplint/core 2.86.1 → 2.86.2
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 -3
- package/package.json +1 -1
package/build/src/registry.js
CHANGED
|
@@ -1269,6 +1269,7 @@ ${indentation} output = ${topTarget}.`;
|
|
|
1269
1269
|
return undefined;
|
|
1270
1270
|
}
|
|
1271
1271
|
outlineCond(node, lowFile, highSyntax) {
|
|
1272
|
+
var _a, _b;
|
|
1272
1273
|
for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {
|
|
1273
1274
|
if (i.getFirstToken().getStr().toUpperCase() !== "COND") {
|
|
1274
1275
|
continue;
|
|
@@ -1278,13 +1279,23 @@ ${indentation} output = ${topTarget}.`;
|
|
|
1278
1279
|
continue;
|
|
1279
1280
|
}
|
|
1280
1281
|
const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
1281
|
-
|
|
1282
|
+
let type = this.findType(i, lowFile, highSyntax);
|
|
1282
1283
|
if (type === undefined) {
|
|
1283
|
-
|
|
1284
|
+
if (node.get() instanceof Statements.Move
|
|
1285
|
+
&& node.findDirectExpression(Expressions.Source) === i
|
|
1286
|
+
&& ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {
|
|
1287
|
+
type = "LIKE " + ((_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());
|
|
1288
|
+
}
|
|
1289
|
+
if (type === undefined) {
|
|
1290
|
+
continue;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
else {
|
|
1294
|
+
type = "TYPE " + type;
|
|
1284
1295
|
}
|
|
1285
1296
|
const indent = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
1286
1297
|
const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);
|
|
1287
|
-
const abap = `DATA ${uniqueName}
|
|
1298
|
+
const abap = `DATA ${uniqueName} ${type}.\n` + bodyCode;
|
|
1288
1299
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);
|
|
1289
1300
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);
|
|
1290
1301
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|