@abaplint/core 2.95.26 → 2.95.27
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 +16 -8
- package/package.json +2 -2
package/build/src/registry.js
CHANGED
|
@@ -1005,7 +1005,7 @@ ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
|
|
|
1005
1005
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, call function parameter", this.getMetadata().key, this.conf.severity, fix);
|
|
1006
1006
|
}
|
|
1007
1007
|
downportCorrespondingSimple(high, lowFile) {
|
|
1008
|
-
var _a;
|
|
1008
|
+
var _a, _b;
|
|
1009
1009
|
if (!(high.get() instanceof Statements.Move)
|
|
1010
1010
|
|| high.getChildren().length !== 4
|
|
1011
1011
|
|| high.getChildren()[2].getFirstToken().getStr().toUpperCase() !== "CORRESPONDING") {
|
|
@@ -1016,14 +1016,22 @@ ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
|
|
|
1016
1016
|
return undefined;
|
|
1017
1017
|
}
|
|
1018
1018
|
const sourceRef = (_a = high.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.CorrespondingBody);
|
|
1019
|
-
if (sourceRef ===
|
|
1020
|
-
|
|
1019
|
+
if ((sourceRef === null || sourceRef === void 0 ? void 0 : sourceRef.getChildren().length) === 1) {
|
|
1020
|
+
const code = `MOVE-CORRESPONDING ${sourceRef.concatTokens()} TO ${target.concatTokens()}`;
|
|
1021
|
+
const start = high.getFirstToken().getStart();
|
|
1022
|
+
const end = high.getLastToken().getStart();
|
|
1023
|
+
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
|
|
1024
|
+
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, simple CORRESPONDING move", this.getMetadata().key, this.conf.severity, fix);
|
|
1025
|
+
}
|
|
1026
|
+
else if ((sourceRef === null || sourceRef === void 0 ? void 0 : sourceRef.getChildren().length) === 5 && ((_b = sourceRef.getFirstChild()) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) === "BASE") {
|
|
1027
|
+
let code = `${target.concatTokens()} = ${sourceRef.getChildren()[2].concatTokens()}.\n`;
|
|
1028
|
+
code += `MOVE-CORRESPONDING ${sourceRef.getChildren()[4].concatTokens()} TO ${target.concatTokens()}`;
|
|
1029
|
+
const start = high.getFirstToken().getStart();
|
|
1030
|
+
const end = high.getLastToken().getStart();
|
|
1031
|
+
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
|
|
1032
|
+
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, CORRESPONDING BASE move", this.getMetadata().key, this.conf.severity, fix);
|
|
1021
1033
|
}
|
|
1022
|
-
|
|
1023
|
-
const start = high.getFirstToken().getStart();
|
|
1024
|
-
const end = high.getLastToken().getStart();
|
|
1025
|
-
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
|
|
1026
|
-
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, simple CORRESPONDING move", this.getMetadata().key, this.conf.severity, fix);
|
|
1034
|
+
return undefined;
|
|
1027
1035
|
}
|
|
1028
1036
|
downportRefSimple(high, lowFile, highSyntax) {
|
|
1029
1037
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.95.
|
|
3
|
+
"version": "2.95.27",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@microsoft/api-extractor": "^7.34.4",
|
|
51
51
|
"@types/chai": "^4.3.4",
|
|
52
52
|
"@types/mocha": "^10.0.1",
|
|
53
|
-
"@types/node": "^18.14.
|
|
53
|
+
"@types/node": "^18.14.4",
|
|
54
54
|
"chai": "^4.3.7",
|
|
55
55
|
"eslint": "^8.35.0",
|
|
56
56
|
"mocha": "^10.2.0",
|