@abaplint/transpiler 2.0.5 → 2.0.8
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.
|
@@ -11,6 +11,18 @@ class SelectTranspiler {
|
|
|
11
11
|
let select = "SELECT ";
|
|
12
12
|
select += ((_a = node.findFirstExpression(abaplint.Expressions.SQLFieldList)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + " ";
|
|
13
13
|
select += ((_b = node.findFirstExpression(abaplint.Expressions.SQLFrom)) === null || _b === void 0 ? void 0 : _b.concatTokens()) + " ";
|
|
14
|
+
const where = node.findFirstExpression(abaplint.Expressions.SQLCond);
|
|
15
|
+
if (where) {
|
|
16
|
+
select += "WHERE " + where.concatTokens() + " ";
|
|
17
|
+
}
|
|
18
|
+
const orderBy = node.findFirstExpression(abaplint.Expressions.SQLOrderBy);
|
|
19
|
+
if (orderBy) {
|
|
20
|
+
select += orderBy.concatTokens() + " ";
|
|
21
|
+
}
|
|
22
|
+
const upTo = node.findFirstExpression(abaplint.Expressions.SQLUpTo);
|
|
23
|
+
if (upTo) {
|
|
24
|
+
select += upTo.concatTokens() + " ";
|
|
25
|
+
}
|
|
14
26
|
for (const d of node.findAllExpressionsRecursive(abaplint.Expressions.Dynamic)) {
|
|
15
27
|
const chain = d.findFirstExpression(abaplint.Expressions.FieldChain);
|
|
16
28
|
if (chain) {
|
|
@@ -20,9 +32,9 @@ class SelectTranspiler {
|
|
|
20
32
|
}
|
|
21
33
|
}
|
|
22
34
|
if (node.concatTokens().toUpperCase().startsWith("SELECT SINGLE ")) {
|
|
23
|
-
select += "
|
|
35
|
+
select += "UP TO 1 ROWS";
|
|
24
36
|
}
|
|
25
|
-
return new chunk_1.Chunk().append(`await abap.statements.select(${target}, "${select.trim()}");`, node, traversal);
|
|
37
|
+
return new chunk_1.Chunk().append(`await abap.statements.select(${target}, {select: "${select.trim()}"});`, node, traversal);
|
|
26
38
|
}
|
|
27
39
|
}
|
|
28
40
|
exports.SelectTranspiler = SelectTranspiler;
|
|
@@ -10,6 +10,9 @@ class ShiftTranspiler {
|
|
|
10
10
|
if (node.findDirectTokenByText("LEFT")) {
|
|
11
11
|
options.push("direction: 'LEFT'");
|
|
12
12
|
}
|
|
13
|
+
else if (node.findDirectTokenByText("RIGHT")) {
|
|
14
|
+
options.push("direction: 'RIGHT'");
|
|
15
|
+
}
|
|
13
16
|
if (node.findDirectTokenByText("CIRCULAR")) {
|
|
14
17
|
options.push("circular: true");
|
|
15
18
|
}
|
|
@@ -17,6 +20,10 @@ class ShiftTranspiler {
|
|
|
17
20
|
if (leading) {
|
|
18
21
|
options.push("deletingLeading: " + traversal.traverse(leading).getCode());
|
|
19
22
|
}
|
|
23
|
+
const trailing = node.findExpressionAfterToken("TRAILING");
|
|
24
|
+
if (trailing) {
|
|
25
|
+
options.push("deletingTrailing: " + traversal.traverse(trailing).getCode());
|
|
26
|
+
}
|
|
20
27
|
const places = node.findExpressionAfterToken("BY");
|
|
21
28
|
if (places) {
|
|
22
29
|
options.push("places: " + traversal.traverse(places).getCode());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"author": "abaplint",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@abaplint/core": "^2.88.
|
|
31
|
+
"@abaplint/core": "^2.88.10",
|
|
32
32
|
"source-map": "^0.7.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@types/chai": "^4.3.
|
|
35
|
+
"@types/chai": "^4.3.1",
|
|
36
36
|
"@types/mocha": "^9.1.0",
|
|
37
37
|
"chai": "^4.3.6",
|
|
38
38
|
"mocha": "^9.2.2",
|