@abaplint/core 2.93.11 → 2.93.12

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.
@@ -4,12 +4,13 @@ exports.CreateData = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const expressions_1 = require("../expressions");
6
6
  const version_1 = require("../../../version");
7
+ // todo, similar to DATA or TYPES?
7
8
  class CreateData {
8
9
  getMatcher() {
9
- // todo, similar to DATA or TYPES?
10
- const area = (0, combi_1.seq)("AREA HANDLE", expressions_1.Source);
10
+ const areaHandle = (0, combi_1.seq)("AREA HANDLE", expressions_1.Source);
11
+ const typeHandle = (0, combi_1.seq)("TYPE HANDLE", expressions_1.Source);
11
12
  const type = (0, combi_1.seq)((0, combi_1.alt)("TYPE", "TYPE REF TO", "TYPE TABLE OF", "TYPE TABLE OF REF TO", "TYPE SORTED TABLE OF", "TYPE HASHED TABLE OF", "TYPE STANDARD TABLE OF", "TYPE LINE OF"), (0, combi_1.alt)(expressions_1.TypeName, expressions_1.Dynamic));
12
- const like = (0, combi_1.seq)((0, combi_1.alt)("LIKE", "LIKE HASHED TABLE OF", "LIKE LINE OF", "LIKE STANDARD TABLE OF", "LIKE SORTED TABLE OF", "LIKE TABLE OF", "TYPE HANDLE"), (0, combi_1.alt)(expressions_1.Source, expressions_1.Dynamic));
13
+ const like = (0, combi_1.seq)((0, combi_1.alt)("LIKE", "LIKE HASHED TABLE OF", "LIKE LINE OF", "LIKE STANDARD TABLE OF", "LIKE SORTED TABLE OF", "LIKE TABLE OF"), (0, combi_1.alt)(expressions_1.Source, expressions_1.Dynamic));
13
14
  const length = (0, combi_1.seq)("LENGTH", expressions_1.Source);
14
15
  const initial = (0, combi_1.seq)("INITIAL SIZE", expressions_1.Source);
15
16
  const decimals = (0, combi_1.seq)("DECIMALS", expressions_1.Source);
@@ -18,7 +19,8 @@ class CreateData {
18
19
  const def = (0, combi_1.seq)((0, combi_1.opt)(uniq), (0, combi_1.alt)("DEFAULT KEY", emptyKey));
19
20
  const kdef = (0, combi_1.seq)((0, combi_1.opt)(uniq), "KEY", (0, combi_1.alt)((0, combi_1.plus)(expressions_1.Field), expressions_1.Dynamic));
20
21
  const key = (0, combi_1.seq)("WITH", (0, combi_1.alt)(def, kdef));
21
- const ret = (0, combi_1.seq)("CREATE DATA", expressions_1.Target, (0, combi_1.opt)(area), (0, combi_1.opt)((0, combi_1.alt)(type, like)), (0, combi_1.opt)(key), (0, combi_1.opt)(initial), (0, combi_1.opt)(length), (0, combi_1.opt)(decimals));
22
+ const specified = (0, combi_1.seq)((0, combi_1.alt)(type, like), (0, combi_1.opt)(key), (0, combi_1.opt)(initial), (0, combi_1.opt)(length), (0, combi_1.opt)(decimals));
23
+ const ret = (0, combi_1.seq)("CREATE DATA", expressions_1.Target, (0, combi_1.opt)((0, combi_1.alt)(typeHandle, (0, combi_1.seq)((0, combi_1.opt)(areaHandle), specified))));
22
24
  return ret;
23
25
  }
24
26
  }
@@ -15,7 +15,7 @@ class MethodDef {
15
15
  const ddl = "DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED";
16
16
  const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, "FOR ACTION", expressions_1.TypeName, "RESULT", expressions_1.MethodParamName), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, "RESULT", expressions_1.MethodParamName), (0, combi_1.seq)("DETERMINE ON MODIFY IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName));
17
17
  // todo, this is only from version something
18
- const amdp = "AMDP OPTIONS CDS SESSION CLIENT current";
18
+ const amdp = (0, combi_1.seq)("AMDP OPTIONS CDS SESSION CLIENT CURRENT", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
19
19
  const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
20
20
  return ret;
21
21
  }
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.11";
66
+ return "2.93.12";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -1317,19 +1317,24 @@ ${indentation} output = ${topTarget}.`;
1317
1317
  return undefined;
1318
1318
  }
1319
1319
  outlineFor(forLoop, indentation, lowFile, highSyntax) {
1320
- var _a, _b, _c, _d, _e;
1320
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1321
1321
  let body = "";
1322
1322
  let end = "";
1323
1323
  const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();
1324
- const loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
1325
- let cond = ((_c = forLoop.findDirectExpression(Expressions.ComponentCond)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "";
1324
+ let loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
1325
+ if (((_d = (_c = forLoop.findDirectExpression(Expressions.InlineLoopDefinition)) === null || _c === void 0 ? void 0 : _c.getFirstChild()) === null || _d === void 0 ? void 0 : _d.get()) instanceof Expressions.TargetFieldSymbol) {
1326
+ loopTargetField = undefined;
1327
+ }
1328
+ let cond = ((_e = forLoop.findDirectExpression(Expressions.ComponentCond)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || "";
1326
1329
  if (cond !== "") {
1327
1330
  cond = " WHERE " + cond;
1328
1331
  }
1332
+ const loop = forLoop.findDirectExpression(Expressions.InlineLoopDefinition);
1333
+ const indexInto = (_f = loop === null || loop === void 0 ? void 0 : loop.findExpressionAfterToken("INTO")) === null || _f === void 0 ? void 0 : _f.concatTokens();
1329
1334
  if (forLoop.findDirectTokenByText("UNTIL")
1330
1335
  || forLoop.findDirectTokenByText("WHILE")) {
1331
1336
  const fieldDef = forLoop.findDirectExpression(Expressions.InlineFieldDefinition);
1332
- const field = (_d = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens();
1337
+ const field = (_g = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.findFirstExpression(Expressions.Field)) === null || _g === void 0 ? void 0 : _g.concatTokens();
1333
1338
  const indexBackup = this.uniqueName(forLoop.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
1334
1339
  body += indentation + "DATA " + field + " TYPE i.\n";
1335
1340
  const second = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.getChildren()[2];
@@ -1351,15 +1356,21 @@ ${indentation} output = ${topTarget}.`;
1351
1356
  }
1352
1357
  end += indentation + "ENDWHILE";
1353
1358
  }
1354
- else if (loopTargetField) {
1359
+ else if (loopTargetField !== undefined) {
1355
1360
  // todo, also backup sy-index / sy-tabix here?
1356
1361
  body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${cond}.\n`;
1362
+ if (indexInto) {
1363
+ body += indentation + " DATA(" + indexInto + ") = sy-tabix.\n";
1364
+ }
1357
1365
  end = "ENDLOOP";
1358
1366
  }
1359
1367
  else if (loopTargetField === undefined) {
1360
1368
  // todo, also backup sy-index / sy-tabix here?
1361
- const loopTargetFieldSymbol = (_e = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens();
1369
+ const loopTargetFieldSymbol = (_h = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _h === void 0 ? void 0 : _h.concatTokens();
1362
1370
  body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol})${cond}.\n`;
1371
+ if (indexInto) {
1372
+ body += indentation + " DATA(" + indexInto + ") = sy-tabix.\n";
1373
+ }
1363
1374
  end = "ENDLOOP";
1364
1375
  }
1365
1376
  const l = forLoop.findDirectExpression(Expressions.Let);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.11",
3
+ "version": "2.93.12",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",