@abaplint/core 2.93.37 → 2.93.38
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.
|
@@ -108,7 +108,14 @@ class Source {
|
|
|
108
108
|
case "FILTER":
|
|
109
109
|
{
|
|
110
110
|
const foundType = this.determineType(node, scope, filename, targetType);
|
|
111
|
-
|
|
111
|
+
const bodyType = new filter_body_1.FilterBody().runSyntax(node.findDirectExpression(Expressions.FilterBody), scope, filename, foundType);
|
|
112
|
+
if (foundType === undefined || foundType.isGeneric()) {
|
|
113
|
+
this.addIfInferred(node, scope, filename, bodyType);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.addIfInferred(node, scope, filename, foundType);
|
|
117
|
+
}
|
|
118
|
+
return foundType ? foundType : bodyType;
|
|
112
119
|
}
|
|
113
120
|
case "CORRESPONDING":
|
|
114
121
|
{
|
package/build/src/registry.js
CHANGED
|
@@ -1544,7 +1544,7 @@ ${indentation} output = ${topTarget}.`;
|
|
|
1544
1544
|
return { body, end };
|
|
1545
1545
|
}
|
|
1546
1546
|
outlineFilter(low, high, lowFile, highSyntax) {
|
|
1547
|
-
var _a
|
|
1547
|
+
var _a;
|
|
1548
1548
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
1549
1549
|
return undefined;
|
|
1550
1550
|
}
|
|
@@ -1557,32 +1557,25 @@ ${indentation} output = ${topTarget}.`;
|
|
|
1557
1557
|
if (filterBody === undefined) {
|
|
1558
1558
|
continue;
|
|
1559
1559
|
}
|
|
1560
|
+
const sourceName = (_a = filterBody.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
1561
|
+
if (sourceName === undefined) {
|
|
1562
|
+
continue;
|
|
1563
|
+
}
|
|
1560
1564
|
let type = this.findType(i, lowFile, highSyntax);
|
|
1561
1565
|
if (type === undefined) {
|
|
1562
|
-
|
|
1563
|
-
&& high.findDirectExpression(Expressions.Source) === i
|
|
1564
|
-
&& ((_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {
|
|
1565
|
-
type = "LIKE " + ((_b = high.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());
|
|
1566
|
-
}
|
|
1567
|
-
if (type === undefined) {
|
|
1568
|
-
continue;
|
|
1569
|
-
}
|
|
1566
|
+
type = "LIKE " + sourceName;
|
|
1570
1567
|
}
|
|
1571
1568
|
else {
|
|
1572
1569
|
type = "TYPE " + type;
|
|
1573
1570
|
}
|
|
1574
|
-
const sourceName = (_c = filterBody.findDirectExpression(Expressions.Source)) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
1575
|
-
if (sourceName === undefined) {
|
|
1576
|
-
continue;
|
|
1577
|
-
}
|
|
1578
1571
|
const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);
|
|
1579
1572
|
const loopName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);
|
|
1580
1573
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
1581
1574
|
let body = "";
|
|
1582
|
-
body +=
|
|
1575
|
+
body += `DATA ${uniqueName} ${type}.\n`;
|
|
1583
1576
|
body += `${indentation}LOOP AT ${sourceName} INTO DATA(${loopName}) ${filterBody.concatTokens().substring(sourceName.length + 1)}.\n`;
|
|
1584
1577
|
body += `${indentation} INSERT ${loopName} INTO TABLE ${uniqueName}.\n`;
|
|
1585
|
-
body += `${indentation}ENDLOOP.\n`;
|
|
1578
|
+
body += `${indentation}ENDLOOP.\n${indentation}`;
|
|
1586
1579
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), body);
|
|
1587
1580
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);
|
|
1588
1581
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|