@abaplint/core 2.85.46 → 2.85.49

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,9 +4,11 @@ exports.ReduceNext = void 0;
4
4
  const combi_1 = require("../combi");
5
5
  const _1 = require(".");
6
6
  const tokens_1 = require("../../1_lexer/tokens");
7
+ const version_1 = require("../../../version");
7
8
  class ReduceNext extends combi_1.Expression {
8
9
  getRunnable() {
9
- const fields = (0, combi_1.seq)(_1.Field, (0, combi_1.altPrio)("=", (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WPlus), "=")), _1.Source);
10
+ const calcAssign = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.WPlus), "="), (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WDash), "="), "/=", "*=", "&&="));
11
+ const fields = (0, combi_1.seq)(_1.Field, (0, combi_1.altPrio)("=", calcAssign), _1.Source);
10
12
  return (0, combi_1.seq)("NEXT", (0, combi_1.plus)(fields));
11
13
  }
12
14
  }
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.85.46";
71
+ return "2.85.49";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -710,7 +710,7 @@ ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
710
710
  const start = high.getFirstToken().getStart();
711
711
  const end = high.getLastToken().getStart();
712
712
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
713
- return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, Reduce statement", this.getMetadata().key, this.conf.severity, fix);
713
+ return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, simple move", this.getMetadata().key, this.conf.severity, fix);
714
714
  }
715
715
  moveWithTableTarget(node, high, lowFile, highSyntax) {
716
716
  if (!(high.get() instanceof Statements.Move)) {
@@ -733,7 +733,7 @@ ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
733
733
  const tName = target.concatTokens().split("[")[0];
734
734
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
735
735
  const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
736
- ${indentation}READ TABLE ${tName} INDEX ${index === null || index === void 0 ? void 0 : index.concatTokens()} ASSIGNING <temp1>.
736
+ ${indentation}READ TABLE ${tName} INDEX ${index === null || index === void 0 ? void 0 : index.concatTokens()} ASSIGNING ${uniqueName}.
737
737
  ${indentation}IF sy-subrc <> 0.
738
738
  ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
739
739
  ${indentation}ENDIF.
@@ -741,7 +741,7 @@ ${indentation}ENDIF.
741
741
  const start = target.getFirstToken().getStart();
742
742
  const end = target.getLastToken().getEnd();
743
743
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
744
- return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, Reduce statement", this.getMetadata().key, this.conf.severity, fix);
744
+ return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, move with table target", this.getMetadata().key, this.conf.severity, fix);
745
745
  }
746
746
  moveWithOperator(high, lowFile) {
747
747
  var _a, _b, _c;
@@ -896,8 +896,8 @@ ${indentation} output = ${topTarget}.`;
896
896
  const cond = forLoop.findFirstExpression(Expressions.Cond);
897
897
  body += indentation + `WHILE NOT ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\n`;
898
898
  const field = (_e = (_d = forLoop.findDirectExpression(Expressions.InlineFieldDefinition)) === null || _d === void 0 ? void 0 : _d.findFirstExpression(Expressions.Field)) === null || _e === void 0 ? void 0 : _e.concatTokens();
899
- body += indentation + ` ${field} = ${field} + 1.\n`;
900
- end = "ENDWHILE";
899
+ end += ` ${field} = ${field} + 1.\n`;
900
+ end += indentation + "ENDWHILE";
901
901
  }
902
902
  else if (forLoop.findDirectTokenByText("WHILE")) {
903
903
  const name = (_f = forLoop.findFirstExpression(Expressions.Field)) === null || _f === void 0 ? void 0 : _f.concatTokens();
@@ -905,8 +905,8 @@ ${indentation} output = ${topTarget}.`;
905
905
  const cond = forLoop.findFirstExpression(Expressions.Cond);
906
906
  body += indentation + `WHILE ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\n`;
907
907
  const field = (_h = (_g = forLoop.findDirectExpression(Expressions.InlineFieldDefinition)) === null || _g === void 0 ? void 0 : _g.findFirstExpression(Expressions.Field)) === null || _h === void 0 ? void 0 : _h.concatTokens();
908
- body += indentation + ` ${field} = ${field} + 1.\n`;
909
- end = "ENDWHILE";
908
+ end += ` ${field} = ${field} + 1.\n`;
909
+ end += indentation + "ENDWHILE";
910
910
  }
911
911
  else if (loopTargetField) {
912
912
  body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField}).\n`;
@@ -1014,17 +1014,18 @@ ${indentation} output = ${topTarget}.`;
1014
1014
  continue;
1015
1015
  }
1016
1016
  for (const n of next.getChildren()) {
1017
- if (n.concatTokens().toUpperCase() === "NEXT") {
1017
+ const concat = n.concatTokens();
1018
+ if (concat.toUpperCase() === "NEXT") {
1018
1019
  continue;
1019
1020
  }
1020
- else if (n.concatTokens() === "=") {
1021
- body += " = ";
1022
- }
1023
1021
  else if (n.get() instanceof Expressions.Field) {
1024
- body += indentation + " " + n.concatTokens();
1022
+ body += indentation + " " + concat + " ";
1025
1023
  }
1026
1024
  else if (n.get() instanceof Expressions.Source) {
1027
- body += n.concatTokens() + ".\n";
1025
+ body += " " + concat + ".\n";
1026
+ }
1027
+ else {
1028
+ body += concat;
1028
1029
  }
1029
1030
  }
1030
1031
  body += indentation + outlineFor.end + `.\n`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.85.46",
3
+ "version": "2.85.49",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -48,7 +48,7 @@
48
48
  "@microsoft/api-extractor": "^7.19.5",
49
49
  "@types/chai": "^4.3.0",
50
50
  "@types/mocha": "^9.1.0",
51
- "@types/node": "^17.0.22",
51
+ "@types/node": "^17.0.23",
52
52
  "chai": "^4.3.6",
53
53
  "eslint": "^8.11.0",
54
54
  "mocha": "^9.2.2",