@abaplint/core 2.95.25 → 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.
|
@@ -4,6 +4,7 @@ exports.Submit = void 0;
|
|
|
4
4
|
const Expressions = require("../../2_statements/expressions");
|
|
5
5
|
const source_1 = require("../expressions/source");
|
|
6
6
|
const target_1 = require("../expressions/target");
|
|
7
|
+
const dynamic_1 = require("../expressions/dynamic");
|
|
7
8
|
class Submit {
|
|
8
9
|
runSyntax(node, scope, filename) {
|
|
9
10
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
@@ -12,6 +13,9 @@ class Submit {
|
|
|
12
13
|
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
13
14
|
new target_1.Target().runSyntax(t, scope, filename);
|
|
14
15
|
}
|
|
16
|
+
for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
17
|
+
new dynamic_1.Dynamic().runSyntax(t, scope, filename);
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
21
|
exports.Submit = Submit;
|
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;
|
|
@@ -2215,6 +2223,9 @@ ${indentation} output = ${topTarget}.`;
|
|
|
2215
2223
|
else if (c.get() instanceof Expressions.Source) {
|
|
2216
2224
|
code += indent + " " + uniqueName + " = " + c.concatTokens() + ".\n";
|
|
2217
2225
|
}
|
|
2226
|
+
else if (c.get() instanceof Expressions.Throw) {
|
|
2227
|
+
code += indent + " " + c.concatTokens().replace("THROW", "RAISE EXCEPTION NEW") + ".\n";
|
|
2228
|
+
}
|
|
2218
2229
|
else {
|
|
2219
2230
|
throw "buildCondBody, unexpected expression, " + c.get().constructor.name;
|
|
2220
2231
|
}
|
|
@@ -21,7 +21,9 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
22
22
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
23
23
|
|
|
24
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
24
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
25
|
+
|
|
26
|
+
Interface method names are ignored`,
|
|
25
27
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
26
28
|
};
|
|
27
29
|
}
|
|
@@ -37,9 +39,6 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscu
|
|
|
37
39
|
for (const classDef of file.getInfo().listClassDefinitions()) {
|
|
38
40
|
methods = methods.concat(classDef.methods);
|
|
39
41
|
}
|
|
40
|
-
for (const intfDef of file.getInfo().listInterfaceDefinitions()) {
|
|
41
|
-
methods = methods.concat(intfDef.methods);
|
|
42
|
-
}
|
|
43
42
|
const builtIn = new _builtin_1.BuiltIn();
|
|
44
43
|
for (const method of methods) {
|
|
45
44
|
if (builtIn.searchBuiltin(method.name.toUpperCase())) {
|
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,9 +50,9 @@
|
|
|
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
|
-
"eslint": "^8.
|
|
55
|
+
"eslint": "^8.35.0",
|
|
56
56
|
"mocha": "^10.2.0",
|
|
57
57
|
"c8": "^7.13.0",
|
|
58
58
|
"source-map-support": "^0.5.21",
|