@abaplint/core 2.91.28 → 2.91.29

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.
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.91.28";
71
+ return "2.91.29";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -201,6 +201,10 @@ Only one transformation is applied to a statement at a time, so multiple steps m
201
201
  if (found) {
202
202
  return found;
203
203
  }
204
+ found = this.assignWithTable(high, lowFile);
205
+ if (found) {
206
+ return found;
207
+ }
204
208
  found = this.downportRefSimple(high, lowFile);
205
209
  if (found) {
206
210
  return found;
@@ -964,6 +968,30 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
964
968
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
965
969
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, REF", this.getMetadata().key, this.conf.severity, fix);
966
970
  }
971
+ assignWithTable(high, lowFile) {
972
+ var _a;
973
+ if (!(high.get() instanceof Statements.Assign)
974
+ || high.getChildren().length !== 5) {
975
+ return undefined;
976
+ }
977
+ const fieldChain = (_a = high.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.FieldChain);
978
+ if ((fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren().length) !== 2) {
979
+ return undefined;
980
+ }
981
+ const tableExpression = fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[1];
982
+ if (!(tableExpression.get() instanceof Expressions.TableExpression)
983
+ || !(tableExpression instanceof nodes_1.ExpressionNode)) {
984
+ return undefined;
985
+ }
986
+ const index = tableExpression.findDirectExpression(Expressions.Source);
987
+ if (index === undefined) {
988
+ return undefined;
989
+ }
990
+ const fsTarget = high.findDirectExpression(Expressions.FSTarget);
991
+ const code = `READ TABLE ${fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[0].concatTokens()} INDEX ${index.concatTokens()} ASSIGNING ${fsTarget === null || fsTarget === void 0 ? void 0 : fsTarget.concatTokens()}.`;
992
+ const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
993
+ return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, ASSIGN table expr", this.getMetadata().key, this.conf.severity, fix);
994
+ }
967
995
  moveWithSimpleValue(high, lowFile) {
968
996
  if (!(high.get() instanceof Statements.Move)
969
997
  || high.getChildren().length !== 4) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.91.28",
3
+ "version": "2.91.29",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -45,10 +45,10 @@
45
45
  },
46
46
  "homepage": "https://abaplint.org",
47
47
  "devDependencies": {
48
- "@microsoft/api-extractor": "^7.29.0",
49
- "@types/chai": "^4.3.1",
48
+ "@microsoft/api-extractor": "^7.29.2",
49
+ "@types/chai": "^4.3.3",
50
50
  "@types/mocha": "^9.1.1",
51
- "@types/node": "^18.6.4",
51
+ "@types/node": "^18.7.2",
52
52
  "chai": "^4.3.6",
53
53
  "eslint": "^8.21.0",
54
54
  "mocha": "^10.0.0",