@abaplint/core 2.91.31 → 2.91.32

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.31";
71
+ return "2.91.32";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -970,8 +970,10 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
970
970
  }
971
971
  assignWithTable(high, lowFile) {
972
972
  var _a, _b;
973
- if (!(high.get() instanceof Statements.Assign)
974
- || high.getChildren().length !== 5) {
973
+ if (!(high.get() instanceof Statements.Assign)) {
974
+ return undefined;
975
+ }
976
+ else if (high.getChildren().length !== 5) {
975
977
  return undefined;
976
978
  }
977
979
  const fieldChain = (_b = (_a = high.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.FieldChain);
@@ -983,12 +985,22 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
983
985
  || !(tableExpression instanceof nodes_1.ExpressionNode)) {
984
986
  return undefined;
985
987
  }
986
- const index = tableExpression.findDirectExpression(Expressions.Source);
987
- if (index === undefined) {
988
- return undefined;
988
+ let condition = "";
989
+ if (tableExpression.getChildren().length === 3) {
990
+ const index = tableExpression.findDirectExpression(Expressions.Source);
991
+ if (index === undefined) {
992
+ return undefined;
993
+ }
994
+ condition = `INDEX ${index.concatTokens()}`;
995
+ }
996
+ else {
997
+ let concat = tableExpression.concatTokens();
998
+ concat = concat.substring(2);
999
+ concat = concat.substring(0, concat.length - 2);
1000
+ condition = `WITH KEY ${concat}`;
989
1001
  }
990
1002
  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()}.`;
1003
+ const code = `READ TABLE ${fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[0].concatTokens()} ${condition} ASSIGNING ${fsTarget === null || fsTarget === void 0 ? void 0 : fsTarget.concatTokens()}.`;
992
1004
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
993
1005
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, ASSIGN table expr", this.getMetadata().key, this.conf.severity, fix);
994
1006
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.91.31",
3
+ "version": "2.91.32",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",