@abaplint/transpiler-cli 2.5.7 → 2.5.9
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/bundle.js +41 -13
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -29085,6 +29085,7 @@ exports.Submit = void 0;
|
|
|
29085
29085
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
29086
29086
|
const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
29087
29087
|
const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js");
|
|
29088
|
+
const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
|
|
29088
29089
|
class Submit {
|
|
29089
29090
|
runSyntax(node, scope, filename) {
|
|
29090
29091
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
@@ -29093,6 +29094,9 @@ class Submit {
|
|
|
29093
29094
|
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
29094
29095
|
new target_1.Target().runSyntax(t, scope, filename);
|
|
29095
29096
|
}
|
|
29097
|
+
for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
29098
|
+
new dynamic_1.Dynamic().runSyntax(t, scope, filename);
|
|
29099
|
+
}
|
|
29096
29100
|
}
|
|
29097
29101
|
}
|
|
29098
29102
|
exports.Submit = Submit;
|
|
@@ -46037,7 +46041,7 @@ class Registry {
|
|
|
46037
46041
|
}
|
|
46038
46042
|
static abaplintVersion() {
|
|
46039
46043
|
// magic, see build script "version.sh"
|
|
46040
|
-
return "2.95.
|
|
46044
|
+
return "2.95.27";
|
|
46041
46045
|
}
|
|
46042
46046
|
getDDICReferences() {
|
|
46043
46047
|
return this.references;
|
|
@@ -51579,7 +51583,7 @@ ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
|
|
|
51579
51583
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, call function parameter", this.getMetadata().key, this.conf.severity, fix);
|
|
51580
51584
|
}
|
|
51581
51585
|
downportCorrespondingSimple(high, lowFile) {
|
|
51582
|
-
var _a;
|
|
51586
|
+
var _a, _b;
|
|
51583
51587
|
if (!(high.get() instanceof Statements.Move)
|
|
51584
51588
|
|| high.getChildren().length !== 4
|
|
51585
51589
|
|| high.getChildren()[2].getFirstToken().getStr().toUpperCase() !== "CORRESPONDING") {
|
|
@@ -51590,14 +51594,22 @@ ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
|
|
|
51590
51594
|
return undefined;
|
|
51591
51595
|
}
|
|
51592
51596
|
const sourceRef = (_a = high.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.CorrespondingBody);
|
|
51593
|
-
if (sourceRef ===
|
|
51594
|
-
|
|
51597
|
+
if ((sourceRef === null || sourceRef === void 0 ? void 0 : sourceRef.getChildren().length) === 1) {
|
|
51598
|
+
const code = `MOVE-CORRESPONDING ${sourceRef.concatTokens()} TO ${target.concatTokens()}`;
|
|
51599
|
+
const start = high.getFirstToken().getStart();
|
|
51600
|
+
const end = high.getLastToken().getStart();
|
|
51601
|
+
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
|
|
51602
|
+
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, simple CORRESPONDING move", this.getMetadata().key, this.conf.severity, fix);
|
|
51603
|
+
}
|
|
51604
|
+
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") {
|
|
51605
|
+
let code = `${target.concatTokens()} = ${sourceRef.getChildren()[2].concatTokens()}.\n`;
|
|
51606
|
+
code += `MOVE-CORRESPONDING ${sourceRef.getChildren()[4].concatTokens()} TO ${target.concatTokens()}`;
|
|
51607
|
+
const start = high.getFirstToken().getStart();
|
|
51608
|
+
const end = high.getLastToken().getStart();
|
|
51609
|
+
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
|
|
51610
|
+
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, CORRESPONDING BASE move", this.getMetadata().key, this.conf.severity, fix);
|
|
51595
51611
|
}
|
|
51596
|
-
|
|
51597
|
-
const start = high.getFirstToken().getStart();
|
|
51598
|
-
const end = high.getLastToken().getStart();
|
|
51599
|
-
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);
|
|
51600
|
-
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, simple CORRESPONDING move", this.getMetadata().key, this.conf.severity, fix);
|
|
51612
|
+
return undefined;
|
|
51601
51613
|
}
|
|
51602
51614
|
downportRefSimple(high, lowFile, highSyntax) {
|
|
51603
51615
|
var _a;
|
|
@@ -52789,6 +52801,9 @@ ${indentation} output = ${topTarget}.`;
|
|
|
52789
52801
|
else if (c.get() instanceof Expressions.Source) {
|
|
52790
52802
|
code += indent + " " + uniqueName + " = " + c.concatTokens() + ".\n";
|
|
52791
52803
|
}
|
|
52804
|
+
else if (c.get() instanceof Expressions.Throw) {
|
|
52805
|
+
code += indent + " " + c.concatTokens().replace("THROW", "RAISE EXCEPTION NEW") + ".\n";
|
|
52806
|
+
}
|
|
52792
52807
|
else {
|
|
52793
52808
|
throw "buildCondBody, unexpected expression, " + c.get().constructor.name;
|
|
52794
52809
|
}
|
|
@@ -57773,7 +57788,9 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
57773
57788
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
57774
57789
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
57775
57790
|
|
|
57776
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
57791
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
57792
|
+
|
|
57793
|
+
Interface method names are ignored`,
|
|
57777
57794
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
57778
57795
|
};
|
|
57779
57796
|
}
|
|
@@ -57789,9 +57806,6 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscu
|
|
|
57789
57806
|
for (const classDef of file.getInfo().listClassDefinitions()) {
|
|
57790
57807
|
methods = methods.concat(classDef.methods);
|
|
57791
57808
|
}
|
|
57792
|
-
for (const intfDef of file.getInfo().listInterfaceDefinitions()) {
|
|
57793
|
-
methods = methods.concat(intfDef.methods);
|
|
57794
|
-
}
|
|
57795
57809
|
const builtIn = new _builtin_1.BuiltIn();
|
|
57796
57810
|
for (const method of methods) {
|
|
57797
57811
|
if (builtIn.searchBuiltin(method.name.toUpperCase())) {
|
|
@@ -73867,6 +73881,10 @@ class ReadTableTranspiler {
|
|
|
73867
73881
|
const s = new expressions_1.SourceTranspiler().transpile(from, traversal).getCode();
|
|
73868
73882
|
extra.push("from: " + s);
|
|
73869
73883
|
}
|
|
73884
|
+
const keyName = node.findExpressionAfterToken("KEY");
|
|
73885
|
+
if (keyName && node.findDirectTokenByText("COMPONENTS")) {
|
|
73886
|
+
extra.push("keyName: \"" + keyName.concatTokens() + "\"");
|
|
73887
|
+
}
|
|
73870
73888
|
const binary = node.findTokenSequencePosition("BINARY", "SEARCH");
|
|
73871
73889
|
if (binary) {
|
|
73872
73890
|
extra.push("binarySearch: true");
|
|
@@ -76650,6 +76668,16 @@ class Traversal {
|
|
|
76650
76668
|
dataFromInterfaces(name, scope) {
|
|
76651
76669
|
let ret = "";
|
|
76652
76670
|
const intf = this.findInterfaceDefinition(name, scope);
|
|
76671
|
+
for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getConstants()) || []) {
|
|
76672
|
+
const fname = Traversal.escapeNamespace(a.getName().toLowerCase());
|
|
76673
|
+
const iname = Traversal.escapeNamespace(intf === null || intf === void 0 ? void 0 : intf.getName().toLowerCase());
|
|
76674
|
+
if ((intf === null || intf === void 0 ? void 0 : intf.isGlobal()) === true) {
|
|
76675
|
+
ret += "this." + iname + "$" + fname + " = abap.Classes['" + (intf === null || intf === void 0 ? void 0 : intf.getName().toUpperCase()) + "']." + iname + "$" + fname + ";\n";
|
|
76676
|
+
}
|
|
76677
|
+
else {
|
|
76678
|
+
ret += "this." + iname + "$" + fname + " = " + iname + "." + iname + "$" + fname + ";\n";
|
|
76679
|
+
}
|
|
76680
|
+
}
|
|
76653
76681
|
for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAttributes().getAll()) || []) {
|
|
76654
76682
|
if (a.getMeta().includes("static" /* abaplint.IdentifierMeta.Static */) === true) {
|
|
76655
76683
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.9",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.5.
|
|
28
|
+
"@abaplint/transpiler": "^2.5.9",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|
|
32
|
-
"@abaplint/core": "^2.95.
|
|
32
|
+
"@abaplint/core": "^2.95.27",
|
|
33
33
|
"progress": "^2.0.3",
|
|
34
34
|
"webpack": "^5.75.0",
|
|
35
35
|
"webpack-cli": "^5.0.1",
|