@abaplint/core 2.105.1 → 2.105.2

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.
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.105.1";
68
+ return "2.105.2";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
@@ -367,6 +367,10 @@ Make sure to test the downported code, it might not always be completely correct
367
367
  if (found) {
368
368
  return found;
369
369
  }
370
+ found = this.assignComponent(low, high, lowFile, highSyntax);
371
+ if (found) {
372
+ return found;
373
+ }
370
374
  found = this.downportRefSimple(high, lowFile, highSyntax);
371
375
  if (found) {
372
376
  return found;
@@ -1476,6 +1480,28 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
1476
1480
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
1477
1481
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, ASSIGN table expr", this.getMetadata().key, this.conf.severity, fix);
1478
1482
  }
1483
+ assignComponent(low, high, lowFile, highSyntax) {
1484
+ if (!(low.get() instanceof _statement_1.Unknown)) {
1485
+ return undefined;
1486
+ }
1487
+ if (!(high.get() instanceof Statements.Assign)) {
1488
+ return undefined;
1489
+ }
1490
+ const assignSource = high.findDirectExpression(Expressions.AssignSource);
1491
+ if (assignSource === undefined || assignSource.getFirstToken().getStr().toUpperCase() !== "COMPONENT") {
1492
+ return undefined;
1493
+ }
1494
+ const componentSource = assignSource.findExpressionAfterToken("COMPONENT");
1495
+ if (componentSource === undefined || componentSource.get() instanceof Expressions.SimpleSource3) {
1496
+ return undefined;
1497
+ }
1498
+ const uniqueName = this.uniqueName(assignSource.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
1499
+ const code = `DATA(${uniqueName}) = ${componentSource.concatTokens()}.\n`;
1500
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
1501
+ const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, componentSource.getFirstToken().getStart(), componentSource.getLastToken().getEnd(), uniqueName);
1502
+ const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
1503
+ return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, ASSIGN COMPONENT source", this.getMetadata().key, this.conf.severity, fix);
1504
+ }
1479
1505
  moveWithSimpleValue(low, high, lowFile) {
1480
1506
  if (!(low.get() instanceof _statement_1.Unknown)) {
1481
1507
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.105.1",
3
+ "version": "2.105.2",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",