@abaplint/core 2.113.230 → 2.113.231

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.
@@ -6351,6 +6351,7 @@ declare class StatementNode extends AbstractNode<ExpressionNode | TokenNode> {
6351
6351
  getLastToken(): Token;
6352
6352
  findDirectExpression(type: new () => IStatementRunnable): ExpressionNode | undefined;
6353
6353
  findDirectExpressions(type: new () => IStatementRunnable): readonly ExpressionNode[];
6354
+ findDirectExpressionsMulti(type: (new () => IStatementRunnable)[]): readonly ExpressionNode[];
6354
6355
  findDirectTokenByText(text: string): Token | undefined;
6355
6356
  findFirstExpression(type: new () => IStatementRunnable): ExpressionNode | undefined;
6356
6357
  findAllExpressions(type: new () => IStatementRunnable): readonly ExpressionNode[];
@@ -4,9 +4,11 @@ exports.ComponentCompareSimple = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
6
  const component_chain_simple_1 = require("./component_chain_simple");
7
+ const version_1 = require("../../../version");
7
8
  class ComponentCompareSimple extends combi_1.Expression {
8
9
  getRunnable() {
9
- const ret = (0, combi_1.seq)((0, combi_1.altPrio)(component_chain_simple_1.ComponentChainSimple, _1.Dynamic), "=", _1.Source);
10
+ const source = (0, combi_1.alt)(_1.SimpleSource4, (0, combi_1.ver)(version_1.Version.v740sp02, _1.Source, version_1.Version.OpenABAP));
11
+ const ret = (0, combi_1.seq)((0, combi_1.altPrio)(component_chain_simple_1.ComponentChainSimple, _1.Dynamic), "=", source);
10
12
  return (0, combi_1.plus)(ret);
11
13
  }
12
14
  }
@@ -6,7 +6,7 @@ const expressions_1 = require("../expressions");
6
6
  const version_1 = require("../../../version");
7
7
  class CallBadi {
8
8
  getMatcher() {
9
- const call = (0, combi_1.seq)("CALL", "BADI", expressions_1.MethodSource, expressions_1.MethodCallBody);
9
+ const call = (0, combi_1.seq)("CALL BADI", expressions_1.MethodSource, expressions_1.MethodCallBody);
10
10
  return (0, combi_1.verNot)(version_1.Version.Cloud, call);
11
11
  }
12
12
  }
@@ -10,11 +10,12 @@ class ReadTable {
10
10
  const comparing = (0, combi_1.seq)("COMPARING", (0, combi_1.alt)((0, combi_1.plus)(expressions_1.FieldSub), (0, combi_1.plus)(expressions_1.Dynamic)));
11
11
  const index = (0, combi_1.seq)("INDEX", expressions_1.Source);
12
12
  const components = (0, combi_1.seq)((0, combi_1.alt)(expressions_1.Field, expressions_1.Dynamic), "COMPONENTS", expressions_1.ComponentCompareSimple);
13
- 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
+ const source = (0, combi_1.alt)(expressions_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source, version_1.Version.OpenABAP));
14
+ 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)("="), source)));
14
15
  const using = (0, combi_1.seq)("USING KEY", (0, combi_1.alt)(expressions_1.Field, expressions_1.Dynamic));
15
- const from = (0, combi_1.seq)("FROM", expressions_1.Source);
16
+ const from = (0, combi_1.seq)("FROM", source);
16
17
  const perm = (0, combi_1.per)((0, combi_1.alt)(index, key, from), expressions_1.ReadTableTarget, using, comparing, "CASTING", (0, combi_1.seq)("TRANSPORTING", (0, combi_1.altPrio)("ALL FIELDS", "NO FIELDS", transporting_fields_1.TransportingFields)), "BINARY SEARCH");
17
- return (0, combi_1.seq)("READ TABLE", (0, combi_1.alt)(expressions_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source, version_1.Version.OpenABAP)), (0, combi_1.opt)(perm));
18
+ return (0, combi_1.seq)("READ TABLE", source, (0, combi_1.opt)(perm));
18
19
  }
19
20
  }
20
21
  exports.ReadTable = ReadTable;
@@ -18,7 +18,7 @@ class ComponentCompareSimple {
18
18
  else if (c.get() instanceof Expressions.Dynamic) {
19
19
  targetType = undefined;
20
20
  }
21
- else if (c.get() instanceof Expressions.Source) {
21
+ else if (c.get() instanceof Expressions.Source || c.get() instanceof Expressions.SimpleSource4) {
22
22
  const sourceType = source_1.Source.runSyntax(c, input, targetType);
23
23
  if (targetType && new _type_utils_1.TypeUtils(input.scope).isAssignable(sourceType, targetType) === false) {
24
24
  const message = "ComponentCompareSimple, incompatible types";
@@ -23,7 +23,7 @@ class FieldChain {
23
23
  if (((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SourceField
24
24
  && node.findDirectExpression(Expressions.ComponentName)) {
25
25
  // workaround for names with dashes, eg. "sy-repid"
26
- const concat = node.concatTokens();
26
+ const concat = node.concatTokens().replace(/ /g, "");
27
27
  const offset = ((_b = node.findDirectExpression(Expressions.FieldOffset)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
28
28
  const length = ((_c = node.findDirectExpression(Expressions.FieldLength)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "";
29
29
  const found = input.scope.findVariable(concat.replace(offset, "").replace(length, ""));
@@ -13,11 +13,8 @@ const _syntax_input_1 = require("../_syntax_input");
13
13
  class ReadTable {
14
14
  runSyntax(node, input) {
15
15
  const concat = node.concatTokens().toUpperCase();
16
- const sources = node.findDirectExpressions(Expressions.Source);
17
- let firstSource = node.findDirectExpression(Expressions.SimpleSource2);
18
- if (firstSource === undefined) {
19
- firstSource = sources[0];
20
- }
16
+ const sources = node.findDirectExpressionsMulti([Expressions.Source, Expressions.SimpleSource2]);
17
+ const firstSource = sources[0];
21
18
  const sourceType = firstSource ? source_1.Source.runSyntax(firstSource, input) : undefined;
22
19
  if (sourceType === undefined) {
23
20
  const message = "No source type determined, read table";
@@ -172,6 +172,15 @@ class StatementNode extends _abstract_node_1.AbstractNode {
172
172
  }
173
173
  return ret;
174
174
  }
175
+ findDirectExpressionsMulti(type) {
176
+ const ret = [];
177
+ for (const child of this.getChildren()) {
178
+ if (child instanceof expression_node_1.ExpressionNode && type.some(t => child.get() instanceof t)) {
179
+ ret.push(child);
180
+ }
181
+ }
182
+ return ret;
183
+ }
175
184
  findDirectTokenByText(text) {
176
185
  const upper = text.toUpperCase();
177
186
  for (const child of this.getChildren()) {
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.230";
70
+ return "2.113.231";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.230",
3
+ "version": "2.113.231",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",