@abaplint/transpiler-cli 2.7.30 → 2.7.31
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 +35 -1
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -47518,7 +47518,7 @@ class Registry {
|
|
|
47518
47518
|
}
|
|
47519
47519
|
static abaplintVersion() {
|
|
47520
47520
|
// magic, see build script "version.sh"
|
|
47521
|
-
return "2.101.
|
|
47521
|
+
return "2.101.34";
|
|
47522
47522
|
}
|
|
47523
47523
|
getDDICReferences() {
|
|
47524
47524
|
return this.ddicReferences;
|
|
@@ -52518,6 +52518,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
52518
52518
|
if (found) {
|
|
52519
52519
|
return found;
|
|
52520
52520
|
}
|
|
52521
|
+
found = this.downportSelectExistence(low, high, lowFile, highSyntax);
|
|
52522
|
+
if (found) {
|
|
52523
|
+
return found;
|
|
52524
|
+
}
|
|
52521
52525
|
found = this.downportSQLExtras(low, high, lowFile, highSyntax);
|
|
52522
52526
|
if (found) {
|
|
52523
52527
|
return found;
|
|
@@ -52647,6 +52651,7 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
52647
52651
|
return undefined;
|
|
52648
52652
|
}
|
|
52649
52653
|
//////////////////////////////////////////
|
|
52654
|
+
/** removes @'s */
|
|
52650
52655
|
downportSQLExtras(low, high, lowFile, highSyntax) {
|
|
52651
52656
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
52652
52657
|
return undefined;
|
|
@@ -52719,6 +52724,35 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
52719
52724
|
}
|
|
52720
52725
|
return undefined;
|
|
52721
52726
|
}
|
|
52727
|
+
downportSelectExistence(low, high, lowFile, highSyntax) {
|
|
52728
|
+
var _a, _b, _c, _d;
|
|
52729
|
+
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
52730
|
+
return undefined;
|
|
52731
|
+
}
|
|
52732
|
+
else if (!(high.get() instanceof Statements.Select)) {
|
|
52733
|
+
return undefined;
|
|
52734
|
+
}
|
|
52735
|
+
const fieldList = high.findFirstExpression(Expressions.SQLFieldList);
|
|
52736
|
+
if ((fieldList === null || fieldList === void 0 ? void 0 : fieldList.concatTokens().toUpperCase()) !== "@ABAP_TRUE") {
|
|
52737
|
+
return undefined;
|
|
52738
|
+
}
|
|
52739
|
+
const fieldName = (_b = (_a = high.findFirstExpression(Expressions.SQLCond)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.SQLFieldName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
52740
|
+
if (fieldName === undefined) {
|
|
52741
|
+
return undefined;
|
|
52742
|
+
}
|
|
52743
|
+
const into = high.findFirstExpression(Expressions.SQLIntoStructure);
|
|
52744
|
+
if (into === undefined) {
|
|
52745
|
+
return undefined;
|
|
52746
|
+
}
|
|
52747
|
+
const intoName = (_d = (_c = into.findFirstExpression(Expressions.SQLTarget)) === null || _c === void 0 ? void 0 : _c.findFirstExpression(Expressions.Target)) === null || _d === void 0 ? void 0 : _d.concatTokens();
|
|
52748
|
+
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
52749
|
+
const fix1 = edit_helper_1.EditHelper.replaceRange(lowFile, fieldList.getFirstToken().getStart(), fieldList.getLastToken().getEnd(), fieldName);
|
|
52750
|
+
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, into === null || into === void 0 ? void 0 : into.getFirstToken().getStart(), into === null || into === void 0 ? void 0 : into.getLastToken().getEnd(), `INTO @DATA(${uniqueName})`);
|
|
52751
|
+
let fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
52752
|
+
const fix3 = edit_helper_1.EditHelper.insertAt(lowFile, high.getLastToken().getEnd(), `\nCLEAR ${intoName}.\nIF sy-subrc = 0.\n ${intoName} = abap_true.\nENDIF.`);
|
|
52753
|
+
fix = edit_helper_1.EditHelper.merge(fix, fix3);
|
|
52754
|
+
return issue_1.Issue.atToken(lowFile, low.getFirstToken(), "SQL, refactor existence check", this.getMetadata().key, this.conf.severity, fix);
|
|
52755
|
+
}
|
|
52722
52756
|
downportSelectInline(low, high, lowFile, highSyntax) {
|
|
52723
52757
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
52724
52758
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.31",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"author": "abaplint",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@abaplint/transpiler": "^2.7.
|
|
29
|
+
"@abaplint/transpiler": "^2.7.31",
|
|
30
30
|
"@types/glob": "^7.2.0",
|
|
31
31
|
"glob": "=7.2.0",
|
|
32
32
|
"@types/progress": "^2.0.5",
|
|
33
|
-
"@types/node": "^20.4.
|
|
34
|
-
"@abaplint/core": "^2.101.
|
|
33
|
+
"@types/node": "^20.4.1",
|
|
34
|
+
"@abaplint/core": "^2.101.34",
|
|
35
35
|
"progress": "^2.0.3",
|
|
36
36
|
"webpack": "^5.88.1",
|
|
37
37
|
"webpack-cli": "^5.1.4",
|