@abaplint/core 2.93.18 → 2.93.20
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.
|
@@ -14,7 +14,7 @@ class For extends combi_1.Expression {
|
|
|
14
14
|
const then = (0, combi_1.seq)("THEN", _1.Source);
|
|
15
15
|
const whil = (0, combi_1.seq)((0, combi_1.altPrio)("UNTIL", "WHILE"), _1.Cond);
|
|
16
16
|
const itera = (0, combi_1.seq)(_1.InlineFieldDefinition, (0, combi_1.opt)(then), whil);
|
|
17
|
-
const groupBy = (0, combi_1.seq)("GROUP BY", (0, combi_1.alt)(field_chain_1.FieldChain, (0, combi_1.seq)("(", (0, combi_1.plus)(_1.LoopGroupByComponent), ")")));
|
|
17
|
+
const groupBy = (0, combi_1.seq)("GROUP BY", (0, combi_1.alt)(field_chain_1.FieldChain, (0, combi_1.seq)("(", (0, combi_1.plus)(_1.LoopGroupByComponent), ")")), (0, combi_1.opt)((0, combi_1.seq)((0, combi_1.alt)("ASCENDING", "DESCENDING"), (0, combi_1.opt)("AS TEXT"))), (0, combi_1.opt)("WITHOUT MEMBERS"));
|
|
18
18
|
const groups = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)("GROUPS", field_chain_1.FieldChain, "OF", _1.Target, "IN", _1.Source, (0, combi_1.optPrio)(groupBy)));
|
|
19
19
|
const f = (0, combi_1.seq)("FOR", (0, combi_1.alt)(itera, inn, groups), (0, combi_1.optPrio)(_1.Let));
|
|
20
20
|
return (0, combi_1.ver)(version_1.Version.v740sp05, f);
|
package/build/src/registry.js
CHANGED
|
@@ -1085,17 +1085,24 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
1085
1085
|
return;
|
|
1086
1086
|
}
|
|
1087
1087
|
const valueBody = source.findDirectExpression(Expressions.ValueBody);
|
|
1088
|
-
if (valueBody === undefined
|
|
1088
|
+
if (valueBody === undefined) {
|
|
1089
1089
|
return;
|
|
1090
1090
|
}
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1091
|
+
const fieldAssignments = valueBody.findDirectExpressions(Expressions.FieldAssignment);
|
|
1092
|
+
if (fieldAssignments.length === 0) {
|
|
1093
|
+
return;
|
|
1094
|
+
}
|
|
1095
|
+
else if (fieldAssignments.length !== valueBody.getChildren().length) {
|
|
1093
1096
|
return;
|
|
1094
1097
|
}
|
|
1095
1098
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
1096
|
-
|
|
1099
|
+
let code = `CLEAR ${target.concatTokens()}.\n`;
|
|
1100
|
+
for (const fieldAssignment of fieldAssignments) {
|
|
1101
|
+
code += indentation + target.concatTokens() + "-" + fieldAssignment.concatTokens() + `.\n`;
|
|
1102
|
+
}
|
|
1103
|
+
code = code.trimEnd();
|
|
1097
1104
|
const start = high.getFirstToken().getStart();
|
|
1098
|
-
const end = high.getLastToken().
|
|
1105
|
+
const end = high.getLastToken().getEnd();
|
|
1099
1106
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
|
|
1100
1107
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, simple move", this.getMetadata().key, this.conf.severity, fix);
|
|
1101
1108
|
}
|
|
@@ -1396,7 +1403,7 @@ ${indentation} output = ${topTarget}.`;
|
|
|
1396
1403
|
if (gby !== "") {
|
|
1397
1404
|
gby += " ";
|
|
1398
1405
|
}
|
|
1399
|
-
gby
|
|
1406
|
+
gby += lg.concatTokens();
|
|
1400
1407
|
}
|
|
1401
1408
|
if (gby !== "") {
|
|
1402
1409
|
gby = " GROUP BY ( " + gby + " )";
|