@abaplint/core 2.83.18 → 2.83.19
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.
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +27 -0
- package/package.json +2 -2
package/build/src/registry.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "2.83.19",
|
|
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.
|
|
51
|
+
"@types/node": "^17.0.8",
|
|
52
52
|
"chai": "^4.3.4",
|
|
53
53
|
"eslint": "^8.6.0",
|
|
54
54
|
"mocha": "^9.1.3",
|