@abaplint/core 2.93.17 → 2.93.19

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);
@@ -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
- return new unknown_type_1.UnknownType("todo, ReduceBody");
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;
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.17";
66
+ return "2.93.19";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -1396,7 +1396,7 @@ ${indentation} output = ${topTarget}.`;
1396
1396
  if (gby !== "") {
1397
1397
  gby += " ";
1398
1398
  }
1399
- gby = lg.concatTokens();
1399
+ gby += lg.concatTokens();
1400
1400
  }
1401
1401
  if (gby !== "") {
1402
1402
  gby = " GROUP BY ( " + gby + " )";
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.17",
3
+ "version": "2.93.19",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",