@abaplint/core 2.93.17 → 2.93.18
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.
|
@@ -13,7 +13,7 @@ class InlineFieldDefinition {
|
|
|
13
13
|
let type = undefined;
|
|
14
14
|
const field = (_a = node.findDirectExpression(Expressions.Field)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
15
15
|
if (field === undefined) {
|
|
16
|
-
return;
|
|
16
|
+
return undefined;
|
|
17
17
|
}
|
|
18
18
|
const source = node.findDirectExpression(Expressions.Source);
|
|
19
19
|
if (source) {
|
|
@@ -33,6 +33,7 @@ class InlineFieldDefinition {
|
|
|
33
33
|
const identifier = new _typed_identifier_1.TypedIdentifier(field, filename, type, ["inline" /* IdentifierMeta.InlineDefinition */]);
|
|
34
34
|
scope.addReference(field, identifier, _reference_1.ReferenceType.DataWriteReference, filename);
|
|
35
35
|
scope.addIdentifier(identifier);
|
|
36
|
+
return type;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
exports.InlineFieldDefinition = InlineFieldDefinition;
|
|
@@ -19,8 +19,12 @@ class ReduceBody {
|
|
|
19
19
|
if (letNode) {
|
|
20
20
|
scoped = new let_1.Let().runSyntax(letNode, scope, filename);
|
|
21
21
|
}
|
|
22
|
+
let first = undefined;
|
|
22
23
|
for (const i of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {
|
|
23
|
-
new inline_field_definition_1.InlineFieldDefinition().runSyntax(i, scope, filename);
|
|
24
|
+
const found = new inline_field_definition_1.InlineFieldDefinition().runSyntax(i, scope, filename);
|
|
25
|
+
if (found && first === undefined) {
|
|
26
|
+
first = found;
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
for (const forNode of node.findDirectExpressions(Expressions.For) || []) {
|
|
26
30
|
new for_1.For().runSyntax(forNode, scope, filename);
|
|
@@ -37,7 +41,12 @@ class ReduceBody {
|
|
|
37
41
|
while (scope.getType() === _scope_type_1.ScopeType.For) {
|
|
38
42
|
scope.pop(node.getLastToken().getEnd());
|
|
39
43
|
}
|
|
40
|
-
|
|
44
|
+
if (first) {
|
|
45
|
+
return first;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return new unknown_type_1.UnknownType("todo, ReduceBody");
|
|
49
|
+
}
|
|
41
50
|
}
|
|
42
51
|
}
|
|
43
52
|
exports.ReduceBody = ReduceBody;
|
package/build/src/registry.js
CHANGED
|
@@ -1405,8 +1405,12 @@ ${indentation} output = ${topTarget}.`;
|
|
|
1405
1405
|
if (groups) {
|
|
1406
1406
|
gby += " INTO DATA(" + groups.concatTokens() + ")";
|
|
1407
1407
|
}
|
|
1408
|
+
let inGroup = "";
|
|
1409
|
+
if (forLoop.concatTokens().toUpperCase().includes(" IN GROUP ")) {
|
|
1410
|
+
inGroup = "-items";
|
|
1411
|
+
}
|
|
1408
1412
|
// todo, also backup sy-index / sy-tabix here?
|
|
1409
|
-
body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${from}${to}${cond}${gby}.\n`;
|
|
1413
|
+
body += indentation + `LOOP AT ${loopSource}${inGroup} INTO DATA(${loopTargetField})${from}${to}${cond}${gby}.\n`;
|
|
1410
1414
|
if (indexInto) {
|
|
1411
1415
|
body += indentation + " DATA(" + indexInto + ") = sy-tabix.\n";
|
|
1412
1416
|
}
|