@abaplint/core 2.113.172 → 2.113.174

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.
@@ -1453,6 +1453,10 @@ declare class CorrespondingBody extends Expression {
1453
1453
  getRunnable(): IStatementRunnable;
1454
1454
  }
1455
1455
 
1456
+ declare class CorrespondingBodyBase extends Expression {
1457
+ getRunnable(): IStatementRunnable;
1458
+ }
1459
+
1456
1460
  declare class CreateData implements IStatement {
1457
1461
  getMatcher(): IStatementRunnable;
1458
1462
  }
@@ -2308,6 +2312,7 @@ declare namespace Expressions {
2308
2312
  ComponentCompareSimple,
2309
2313
  ValueBase,
2310
2314
  ComponentCompareSingle,
2315
+ CorrespondingBodyBase,
2311
2316
  ComponentCompare,
2312
2317
  ComponentCondSub,
2313
2318
  ComponentCond,
@@ -10,7 +10,7 @@ class Cast extends combi_1.Expression {
10
10
  getRunnable() {
11
11
  const rparen = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight));
12
12
  const cast = (0, combi_1.seq)("CAST", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.optPrio)(let_1.Let), _1.Source, rparen);
13
- return (0, combi_1.ver)(version_1.Version.v740sp02, cast);
13
+ return (0, combi_1.ver)(version_1.Version.v740sp02, cast, version_1.Version.OpenABAP);
14
14
  }
15
15
  }
16
16
  exports.Cast = Cast;
@@ -2,16 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CorrespondingBody = void 0;
4
4
  const combi_1 = require("../combi");
5
- const tokens_1 = require("../../1_lexer/tokens");
6
5
  const _1 = require(".");
7
6
  const version_1 = require("../../../version");
8
7
  const component_chain_1 = require("./component_chain");
9
8
  class CorrespondingBody extends combi_1.Expression {
10
9
  getRunnable() {
11
10
  const mapping = (0, combi_1.seq)("MAPPING", (0, combi_1.plus)((0, combi_1.seq)(_1.ComponentName, "=", component_chain_1.ComponentChain)));
12
- const baseParen = (0, combi_1.seq)("BASE", (0, combi_1.tok)(tokens_1.WParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
13
11
  const discarding = (0, combi_1.ver)(version_1.Version.v751, "DISCARDING DUPLICATES");
14
- return (0, combi_1.seq)((0, combi_1.optPrio)("DEEP"), (0, combi_1.optPrio)(baseParen), _1.Source, (0, combi_1.optPrio)(discarding), (0, combi_1.optPrio)(mapping), (0, combi_1.optPrio)("CHANGING CONTROL"), (0, combi_1.optPrio)((0, combi_1.seq)("MAPPING FROM ENTITY", (0, combi_1.optPrio)("USING CONTROL"))), // todo, version something?
12
+ return (0, combi_1.seq)((0, combi_1.optPrio)("DEEP"), (0, combi_1.optPrio)(_1.CorrespondingBodyBase), _1.Source, (0, combi_1.optPrio)(discarding), (0, combi_1.optPrio)(mapping), (0, combi_1.optPrio)("CHANGING CONTROL"), (0, combi_1.optPrio)((0, combi_1.seq)("MAPPING FROM ENTITY", (0, combi_1.optPrio)("USING CONTROL"))), // todo, version something?
15
13
  (0, combi_1.optPrio)((0, combi_1.seq)("EXCEPT", (0, combi_1.alt)((0, combi_1.plus)(_1.Field), "*"))));
16
14
  }
17
15
  }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CorrespondingBodyBase = void 0;
4
+ const combi_1 = require("../combi");
5
+ const tokens_1 = require("../../1_lexer/tokens");
6
+ const _1 = require(".");
7
+ class CorrespondingBodyBase extends combi_1.Expression {
8
+ getRunnable() {
9
+ return (0, combi_1.seq)("BASE", (0, combi_1.tok)(tokens_1.WParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
10
+ }
11
+ }
12
+ exports.CorrespondingBodyBase = CorrespondingBodyBase;
13
+ //# sourceMappingURL=corresponding_body_base.js.map
@@ -41,6 +41,7 @@ __exportStar(require("./component_chain"), exports);
41
41
  __exportStar(require("./component_compare_simple"), exports);
42
42
  __exportStar(require("./value_base"), exports);
43
43
  __exportStar(require("./component_compare_single"), exports);
44
+ __exportStar(require("./corresponding_body_base"), exports);
44
45
  __exportStar(require("./component_compare"), exports);
45
46
  __exportStar(require("./component_cond_sub"), exports);
46
47
  __exportStar(require("./component_cond"), exports);
@@ -25,7 +25,7 @@ class Source extends combi_1.Expression {
25
25
  const bool = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.ver)(version_1.Version.v702, (0, combi_1.regex)(/^BOOLC$/i), version_1.Version.OpenABAP), (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.regex)(/^XSDBOOL$/i), version_1.Version.OpenABAP)), (0, combi_1.tok)(tokens_1.ParenLeftW), _1.Cond, ")");
26
26
  const prefix = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlus), "BIT-NOT");
27
27
  const old = (0, combi_1.seq)((0, combi_1.optPrio)(prefix), (0, combi_1.altPrio)(_1.Constant, _1.StringTemplate, text_element_1.TextElement, bool, method, (0, combi_1.seq)(_1.FieldChain, deref), paren), (0, combi_1.optPrio)(after));
28
- const corr = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CORRESPONDING", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CorrespondingBody, rparen, (0, combi_1.optPrio)(after)));
28
+ const corr = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CORRESPONDING", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CorrespondingBody, rparen, (0, combi_1.optPrio)(after)), version_1.Version.OpenABAP);
29
29
  const conv = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("CONV", _1.TypeNameOrInfer, lparenNoSpace, _1.ConvBody, rparenNoSpace, (0, combi_1.optPrio)(after)), version_1.Version.OpenABAP);
30
30
  const swit = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("SWITCH", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.SwitchBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
31
31
  const value = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("VALUE", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.ValueBody, rparenNoSpace, (0, combi_1.optPrio)(after)), version_1.Version.OpenABAP);
@@ -11,7 +11,7 @@ class TableExpression extends combi_1.Expression {
11
11
  const key = (0, combi_1.seq)("KEY", _1.SimpleName);
12
12
  const index = (0, combi_1.seq)("INDEX", _1.Source);
13
13
  const ret = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.BracketLeftW), (0, combi_1.alt)(_1.Source, (0, combi_1.seq)((0, combi_1.optPrio)(key), (0, combi_1.opt)("COMPONENTS"), (0, combi_1.altPrio)(fields, index))), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WBracketRight), (0, combi_1.tok)(tokens_1.WBracketRightW)));
14
- return (0, combi_1.ver)(version_1.Version.v740sp02, ret);
14
+ return (0, combi_1.ver)(version_1.Version.v740sp02, ret, version_1.Version.OpenABAP);
15
15
  }
16
16
  }
17
17
  exports.TableExpression = TableExpression;
@@ -5,9 +5,14 @@ const Expressions = require("../../2_statements/expressions");
5
5
  const source_1 = require("./source");
6
6
  class CorrespondingBody {
7
7
  static runSyntax(node, input, targetType) {
8
+ var _a;
8
9
  if (node === undefined) {
9
10
  return targetType;
10
11
  }
12
+ const base = (_a = node.findDirectExpression(Expressions.CorrespondingBodyBase)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source);
13
+ if (base) {
14
+ source_1.Source.runSyntax(base, input);
15
+ }
11
16
  let type = undefined;
12
17
  for (const s of node.findDirectExpressions(Expressions.Source)) {
13
18
  if (type === undefined) {
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.172";
70
+ return "2.113.174";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -1313,7 +1313,7 @@ ${indentation}${uniqueName2}->if_t100_message~t100key = ${uniqueName1}.\n`;
1313
1313
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, call function parameter", this.getMetadata().key, this.conf.severity, fix);
1314
1314
  }
1315
1315
  downportCorrespondingSimple(high, lowFile) {
1316
- var _a, _b;
1316
+ var _a;
1317
1317
  if (!(high.get() instanceof Statements.Move)
1318
1318
  || high.getChildren().length !== 4
1319
1319
  || high.getChildren()[2].getFirstToken().getStr().toUpperCase() !== "CORRESPONDING") {
@@ -1331,9 +1331,10 @@ ${indentation}${uniqueName2}->if_t100_message~t100key = ${uniqueName1}.\n`;
1331
1331
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
1332
1332
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, simple CORRESPONDING move", this.getMetadata().key, this.conf.severity, fix);
1333
1333
  }
1334
- else if ((sourceRef === null || sourceRef === void 0 ? void 0 : sourceRef.getChildren().length) === 5 && ((_b = sourceRef.getFirstChild()) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) === "BASE") {
1335
- let code = `${target.concatTokens()} = ${sourceRef.getChildren()[2].concatTokens()}.\n`;
1336
- code += `MOVE-CORRESPONDING ${sourceRef.getChildren()[4].concatTokens()} TO ${target.concatTokens()}`;
1334
+ else if ((sourceRef === null || sourceRef === void 0 ? void 0 : sourceRef.getChildren().length) === 2 && sourceRef.findDirectExpression(Expressions.CorrespondingBodyBase) !== undefined) {
1335
+ const base = sourceRef.findDirectExpression(Expressions.CorrespondingBodyBase);
1336
+ let code = `${target.concatTokens()} = ${base.getChildren()[2].concatTokens()}.\n`;
1337
+ code += `MOVE-CORRESPONDING ${sourceRef.getChildren()[1].concatTokens()} TO ${target.concatTokens()}`;
1337
1338
  const start = high.getFirstToken().getStart();
1338
1339
  const end = high.getLastToken().getStart();
1339
1340
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.172",
3
+ "version": "2.113.174",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",