@abaplint/core 2.91.33 → 2.91.34

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fail = exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;
3
+ exports.failStar = exports.failCombinator = exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;
4
4
  const Tokens = require("../1_lexer/tokens");
5
5
  const nodes_1 = require("../nodes");
6
6
  const version_1 = require("../../version");
@@ -270,15 +270,23 @@ class Star {
270
270
  }
271
271
  run(r) {
272
272
  const result = r;
273
- let res = r;
274
- let input = [];
275
- for (;;) {
276
- input = res;
277
- res = this.sta.run(input);
278
- if (res.length === 0) {
279
- break;
273
+ try {
274
+ let res = r;
275
+ let input = [];
276
+ for (;;) {
277
+ input = res;
278
+ res = this.sta.run(input);
279
+ if (res.length === 0) {
280
+ break;
281
+ }
282
+ result.push(...res);
280
283
  }
281
- result.push(...res);
284
+ }
285
+ catch (err) {
286
+ if (err instanceof FailStarError) {
287
+ return result;
288
+ }
289
+ throw err;
282
290
  }
283
291
  // console.dir(result);
284
292
  return result;
@@ -572,9 +580,32 @@ class Permutation {
572
580
  return [""];
573
581
  }
574
582
  }
575
- class FailCombinator extends Error {
583
+ class FailCombinatorError extends Error {
584
+ }
585
+ class FailStarError extends Error {
586
+ }
587
+ class FailCombinator {
588
+ listKeywords() {
589
+ return [];
590
+ }
591
+ getUsing() {
592
+ return [];
593
+ }
594
+ run(_r) {
595
+ throw new FailCombinatorError();
596
+ }
597
+ railroad() {
598
+ return "Railroad.Terminal('!FailCombinator')";
599
+ }
600
+ toStr() {
601
+ return "fail()";
602
+ }
603
+ first() {
604
+ return [];
605
+ }
576
606
  }
577
- class Fail {
607
+ // Note that Plus is implemented with Star
608
+ class FailStar {
578
609
  listKeywords() {
579
610
  return [];
580
611
  }
@@ -582,10 +613,10 @@ class Fail {
582
613
  return [];
583
614
  }
584
615
  run(_r) {
585
- throw new FailCombinator();
616
+ throw new FailStarError();
586
617
  }
587
618
  railroad() {
588
- return "Railroad.Terminal('!Fail')";
619
+ return "Railroad.Terminal('!FailStar')";
589
620
  }
590
621
  toStr() {
591
622
  return "fail()";
@@ -749,7 +780,7 @@ class Combi {
749
780
  }
750
781
  }
751
782
  catch (err) {
752
- if (err instanceof FailCombinator) {
783
+ if (err instanceof FailCombinatorError) {
753
784
  return undefined;
754
785
  }
755
786
  throw err;
@@ -854,8 +885,12 @@ function verNot(version, first) {
854
885
  return new VersNot(version, map(first));
855
886
  }
856
887
  exports.verNot = verNot;
857
- function fail() {
858
- return new Fail();
888
+ function failCombinator() {
889
+ return new FailCombinator();
890
+ }
891
+ exports.failCombinator = failCombinator;
892
+ function failStar() {
893
+ return new FailStar();
859
894
  }
860
- exports.fail = fail;
895
+ exports.failStar = failStar;
861
896
  //# sourceMappingURL=combi.js.map
@@ -14,6 +14,8 @@ class TypeTable extends combi_1.Expression {
14
14
  const likeType = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), (0, combi_1.opt)(field_chain_1.FieldChain), (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));
15
15
  const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.opt)(header), (0, combi_1.opt)(initial));
16
16
  const rangeLike = (0, combi_1.seq)("RANGE OF", _1.SimpleFieldChain, (0, combi_1.opt)(header), (0, combi_1.opt)(initial));
17
+ // a maximum of 15 secondary table keys can be defined
18
+ // "WITH" is not allowed as a field name in keys
17
19
  const typetable = (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial))));
18
20
  const occurs = (0, combi_1.seq)("OCCURS", _1.Integer);
19
21
  const derived = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("TABLE FOR", (0, combi_1.altPrio)("CREATE", "FAILED", "LOCK", "ACTION IMPORT", "UPDATE", "READ RESULT", "ACTION RESULT"), _1.TypeName));
@@ -9,7 +9,8 @@ class TypeTableKey extends combi_1.Expression {
9
9
  const uniqueness = (0, combi_1.alt)("NON-UNIQUE", "UNIQUE");
10
10
  const defaultKey = "DEFAULT KEY";
11
11
  const emptyKey = (0, combi_1.ver)(version_1.Version.v740sp02, "EMPTY KEY");
12
- const key = (0, combi_1.seq)("WITH", (0, combi_1.opt)(uniqueness), (0, combi_1.altPrio)(defaultKey, emptyKey, (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("SORTED", "HASHED")), "KEY", (0, combi_1.alt)((0, combi_1.seq)(_1.Field, "COMPONENTS", (0, combi_1.plus)(_1.FieldSub)), (0, combi_1.plus)(_1.FieldSub)))), (0, combi_1.optPrio)("READ-ONLY"));
12
+ const components = (0, combi_1.plus)((0, combi_1.alt)((0, combi_1.seq)("WITH", (0, combi_1.failStar)()), _1.FieldSub));
13
+ const key = (0, combi_1.seq)("WITH", (0, combi_1.opt)(uniqueness), (0, combi_1.altPrio)(defaultKey, emptyKey, (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("SORTED", "HASHED")), "KEY", (0, combi_1.alt)((0, combi_1.seq)(_1.Field, "COMPONENTS", components), components))), (0, combi_1.optPrio)("READ-ONLY"));
13
14
  return key;
14
15
  }
15
16
  }
@@ -14,7 +14,7 @@ class Loop {
14
14
  const to = (0, combi_1.seq)("TO", expressions_1.Source);
15
15
  const usingKey = (0, combi_1.seq)("USING KEY", (0, combi_1.altPrio)(expressions_1.SimpleName, expressions_1.Dynamic));
16
16
  const options = (0, combi_1.per)(expressions_1.LoopTarget, from, to, where, usingKey, group);
17
- const at = (0, combi_1.seq)("AT", (0, combi_1.opt)((0, combi_1.seq)("SCREEN", (0, combi_1.fail)())), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, "GROUP")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));
17
+ const at = (0, combi_1.seq)("AT", (0, combi_1.opt)((0, combi_1.seq)("SCREEN", (0, combi_1.failCombinator)())), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, "GROUP")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));
18
18
  return (0, combi_1.seq)("LOOP", (0, combi_1.opt)(at));
19
19
  }
20
20
  }
@@ -12,7 +12,8 @@ class ReadTable {
12
12
  const key = (0, combi_1.seq)((0, combi_1.altPrio)("WITH KEY", "WITH TABLE KEY"), (0, combi_1.alt)(expressions_1.ComponentCompareSimple, components, (0, combi_1.seq)((0, combi_1.optPrio)("="), expressions_1.Source)));
13
13
  const using = (0, combi_1.seq)("USING KEY", (0, combi_1.alt)(expressions_1.Field, expressions_1.Dynamic));
14
14
  const from = (0, combi_1.seq)("FROM", expressions_1.Source);
15
- const perm = (0, combi_1.per)((0, combi_1.alt)(index, key, from), expressions_1.ReadTableTarget, using, comparing, "CASTING", "TRANSPORTING ALL FIELDS", (0, combi_1.seq)("TRANSPORTING", (0, combi_1.altPrio)(expressions_1.Dynamic, (0, combi_1.plus)(expressions_1.Field))), "BINARY SEARCH");
15
+ const fields = (0, combi_1.plus)((0, combi_1.alt)((0, combi_1.seq)("INTO", (0, combi_1.failStar)()), expressions_1.FieldSub));
16
+ const perm = (0, combi_1.per)((0, combi_1.alt)(index, key, from), expressions_1.ReadTableTarget, using, comparing, "CASTING", "TRANSPORTING ALL FIELDS", (0, combi_1.seq)("TRANSPORTING", (0, combi_1.altPrio)(expressions_1.Dynamic, fields)), "BINARY SEARCH");
16
17
  return (0, combi_1.seq)("READ TABLE", (0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source), expressions_1.SimpleSource2), (0, combi_1.opt)(perm));
17
18
  }
18
19
  }
@@ -9,7 +9,7 @@ class TypeTableKey {
9
9
  const rowType = type.getRowType();
10
10
  if (rowType instanceof basic_1.StructureType) {
11
11
  for (const c of node.findAllExpressions(Expressions.FieldSub)) {
12
- const concat = c.concatTokens();
12
+ const concat = c.concatTokens().replace(/^!/, "");
13
13
  if (concat.includes("-") === false // todo, properly check sub fields
14
14
  && rowType.getComponentByName(concat) === undefined
15
15
  && concat.toUpperCase() !== "TABLE_LINE") {
@@ -6,7 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSCondition extends combi_1.Expression {
7
7
  getRunnable() {
8
8
  const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", (0, combi_1.alt)(_1.CDSName, _1.CDSString))));
9
- const eq = (0, combi_1.seq)(name, (0, combi_1.alt)("=", "<>", "<", ">", ">=", "<=", "LIKE"), (0, combi_1.alt)(name, _1.CDSFunction, _1.CDSString));
9
+ const eq = (0, combi_1.seq)(name, (0, combi_1.alt)("=", "<>", "<", ">", ">=", "<=", "LIKE", "NOT LIKE"), (0, combi_1.alt)(name, _1.CDSFunction, _1.CDSString));
10
10
  const isInitial = (0, combi_1.seq)(name, "IS INITIAL");
11
11
  const isNotInitial = (0, combi_1.seq)(name, "IS NOT INITIAL");
12
12
  const isNull = (0, combi_1.seq)(name, "IS NULL");
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.91.33";
71
+ return "2.91.34";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.91.33",
3
+ "version": "2.91.34",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",