@abaplint/core 2.83.17 → 2.83.21

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.83.17";
71
+ return "2.83.21";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
@@ -190,6 +190,18 @@ foo = VALUE #(
190
190
  right: children[2],
191
191
  });
192
192
  }
193
+ const ex = raise.findDirectExpression(Expressions.ParameterListExceptions);
194
+ for (const e of (ex === null || ex === void 0 ? void 0 : ex.getChildren()) || []) {
195
+ const children = e.getChildren();
196
+ if (children.length < 3) {
197
+ continue; // unexpected
198
+ }
199
+ parameters.push({
200
+ left: children[0],
201
+ eq: children[1].getFirstToken().getStart(),
202
+ right: children[2],
203
+ });
204
+ }
193
205
  if (parameters.length > 0) {
194
206
  candidates.push({ parameters });
195
207
  }
@@ -47,10 +47,10 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
47
47
  if (structure === undefined) {
48
48
  return [];
49
49
  }
50
- // one fix per file
51
- this.fixed = false;
52
50
  const routines = structure.findAllStructures(Structures.Form).concat(structure.findAllStructures(Structures.Method));
53
51
  for (const r of routines) {
52
+ // one fix per routine
53
+ this.fixed = false;
54
54
  this.mode = DEFINITION;
55
55
  this.moveTo = r.getFirstStatement();
56
56
  const found = this.walk(r, file);
@@ -89,7 +89,7 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
89
89
  || c.get() instanceof Statements.Static
90
90
  || c.get() instanceof Statements.FieldSymbol)) {
91
91
  if (this.mode === AFTER) {
92
- // only one fix per file, as it reorders a lot
92
+ // only one fix per routine, as it reorders a lot
93
93
  let fix = undefined;
94
94
  if (this.fixed === false && this.moveTo) {
95
95
  fix = this.buildFix(file, c, this.moveTo);
@@ -55,6 +55,7 @@ Current rules:
55
55
  * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
56
56
  * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57
57
  * RAISE EXCEPTION ... MESSAGE
58
+ * APPEND expression is outlined
58
59
 
59
60
  Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,
60
61
  tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
@@ -223,6 +224,10 @@ Only one transformation is applied to a statement at a time, so multiple steps m
223
224
  if (found) {
224
225
  return found;
225
226
  }
227
+ found = this.replaceAppendExpression(high, lowFile, highSyntax);
228
+ if (found) {
229
+ return found;
230
+ }
226
231
  // todo, add more rules here
227
232
  return undefined;
228
233
  }
@@ -364,6 +369,28 @@ ${indentation}`);
364
369
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
365
370
  return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), "Outline SELECT @DATA", this.getMetadata().key, this.conf.severity, fix);
366
371
  }
372
+ replaceAppendExpression(high, lowFile, highSyntax) {
373
+ if (!(high.get() instanceof Statements.Append)) {
374
+ return undefined;
375
+ }
376
+ const children = high.getChildren();
377
+ if (children[1].get() instanceof Expressions.Source) {
378
+ const source = children[1];
379
+ const target = high.findDirectExpression(Expressions.Target);
380
+ if (target === undefined) {
381
+ return undefined;
382
+ }
383
+ const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
384
+ const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
385
+ const firstToken = high.getFirstToken();
386
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
387
+ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
388
+ const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
389
+ const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
390
+ return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Outline APPEND source expression", this.getMetadata().key, this.conf.severity, fix);
391
+ }
392
+ return undefined;
393
+ }
367
394
  replaceTableExpression(node, lowFile, highSyntax) {
368
395
  var _a;
369
396
  for (const fieldChain of node.findAllExpressionsRecursive(Expressions.FieldChain)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.83.17",
3
+ "version": "2.83.21",
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.3",
49
49
  "@types/chai": "^4.3.0",
50
50
  "@types/mocha": "^9.0.0",
51
- "@types/node": "^17.0.5",
51
+ "@types/node": "^17.0.8",
52
52
  "chai": "^4.3.4",
53
53
  "eslint": "^8.6.0",
54
54
  "mocha": "^9.1.3",