@abaplint/transpiler-cli 2.13.27 → 2.13.28
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 +16 -1
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -84539,7 +84539,7 @@ class SQLCondTranspiler {
|
|
|
84539
84539
|
if (c.findDirectExpression(abaplint.Expressions.Dynamic)) {
|
|
84540
84540
|
const chain = c.findDirectExpression(abaplint.Expressions.Dynamic)?.findFirstExpression(abaplint.Expressions.FieldChain);
|
|
84541
84541
|
if (chain) {
|
|
84542
|
-
const code = new field_chain_1.FieldChainTranspiler(
|
|
84542
|
+
const code = new field_chain_1.FieldChainTranspiler(false).transpile(chain, traversal).getCode();
|
|
84543
84543
|
ret += `" + abap.expandDynamic(${code}, (name) => {try { return eval(name);} catch {}}) + "`;
|
|
84544
84544
|
}
|
|
84545
84545
|
else {
|
|
@@ -92542,6 +92542,8 @@ class SelectTranspiler {
|
|
|
92542
92542
|
select += new expressions_1.SQLOrderByTranspiler().transpile(orderBy, traversal).getCode();
|
|
92543
92543
|
}
|
|
92544
92544
|
const fieldListDynamics = new Set(fieldList.findAllExpressionsRecursive(abaplint.Expressions.Dynamic));
|
|
92545
|
+
const groupByDynamics = new Set(groupBy?.findAllExpressionsRecursive(abaplint.Expressions.Dynamic) || []);
|
|
92546
|
+
const orderByDynamics = new Set(orderBy?.findAllExpressionsRecursive(abaplint.Expressions.Dynamic) || []);
|
|
92545
92547
|
for (const d of node.findAllExpressionsRecursive(abaplint.Expressions.Dynamic)) {
|
|
92546
92548
|
const chain = d.findFirstExpression(abaplint.Expressions.FieldChain);
|
|
92547
92549
|
if (chain) {
|
|
@@ -92550,6 +92552,14 @@ class SelectTranspiler {
|
|
|
92550
92552
|
const code = new expressions_1.FieldChainTranspiler(false).transpile(chain, traversal).getCode();
|
|
92551
92553
|
select = select.replace(search, `" + ${this.dynamicSelectList(code)} + "`);
|
|
92552
92554
|
}
|
|
92555
|
+
else if (groupByDynamics.has(d)) {
|
|
92556
|
+
const code = new expressions_1.FieldChainTranspiler(false).transpile(chain, traversal).getCode();
|
|
92557
|
+
select = select.replace("GROUP BY " + search, `" + ${this.dynamicSQLClause("GROUP BY", code)} + "`);
|
|
92558
|
+
}
|
|
92559
|
+
else if (orderByDynamics.has(d)) {
|
|
92560
|
+
const code = new expressions_1.FieldChainTranspiler(false).transpile(chain, traversal).getCode();
|
|
92561
|
+
select = select.replace("ORDER BY " + search, `" + ${this.dynamicSQLClause("ORDER BY", code)} + "`);
|
|
92562
|
+
}
|
|
92553
92563
|
else {
|
|
92554
92564
|
const code = new expressions_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();
|
|
92555
92565
|
select = select.replace(search, `" + ${code} + "`);
|
|
@@ -92620,6 +92630,11 @@ class SelectTranspiler {
|
|
|
92620
92630
|
+ ` ? (${code}.array().length === 0 ? "*" : ${code}.array().map(row => row.get()).join(", "))`
|
|
92621
92631
|
+ ` : ${code}.get())`;
|
|
92622
92632
|
}
|
|
92633
|
+
dynamicSQLClause(keyword, code) {
|
|
92634
|
+
return `(${code} instanceof abap.types.Table || ${code} instanceof abap.types.HashedTable`
|
|
92635
|
+
+ ` ? (${code}.array().length === 0 ? "" : "${keyword} " + ${code}.array().map(row => row.get()).join(" "))`
|
|
92636
|
+
+ ` : "${keyword} " + ${code}.get())`;
|
|
92637
|
+
}
|
|
92623
92638
|
isWhereExpression(node, expression) {
|
|
92624
92639
|
// check if previous token before sqlCond is "WHERE". It could also be "ON" in case of join condition
|
|
92625
92640
|
let prevToken;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.28",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@abaplint/core": "^2.119.24",
|
|
31
|
-
"@abaplint/transpiler": "^2.13.
|
|
31
|
+
"@abaplint/transpiler": "^2.13.28",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^24.12.2",
|
|
34
34
|
"@types/progress": "^2.0.7",
|