@abaplint/transpiler-cli 2.3.121 → 2.3.123
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 +23 -3
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -68500,7 +68500,7 @@ class SQLCondTranspiler {
|
|
|
68500
68500
|
const chain = (_a = c.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(abaplint.Expressions.FieldChain);
|
|
68501
68501
|
if (chain) {
|
|
68502
68502
|
const code = new field_chain_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();
|
|
68503
|
-
ret += `" + ${code} + "`;
|
|
68503
|
+
ret += `" + (${code} === "" ? "1 = 1" : ${code}) + "`;
|
|
68504
68504
|
}
|
|
68505
68505
|
else {
|
|
68506
68506
|
throw new Error("SQL Condition, transpiler todo, dyn cond, " + c.concatTokens());
|
|
@@ -72561,7 +72561,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
|
|
|
72561
72561
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
72562
72562
|
class LoopTranspiler {
|
|
72563
72563
|
transpile(node, traversal) {
|
|
72564
|
-
var _a, _b;
|
|
72564
|
+
var _a, _b, _c;
|
|
72565
72565
|
if (!(node.get() instanceof abaplint.Statements.Loop)) {
|
|
72566
72566
|
throw new Error("LoopTranspiler, unexpected node");
|
|
72567
72567
|
}
|
|
@@ -72620,12 +72620,32 @@ class LoopTranspiler {
|
|
|
72620
72620
|
extra.push(`usingKey: "${keyNode.concatTokens()}"`);
|
|
72621
72621
|
}
|
|
72622
72622
|
}
|
|
72623
|
-
const whereNode = node.
|
|
72623
|
+
const whereNode = node.findDirectExpression(abaplint.Expressions.ComponentCond);
|
|
72624
72624
|
if (whereNode) {
|
|
72625
72625
|
const where = traversal.traverse(whereNode).getCode();
|
|
72626
72626
|
// todo, evil workaround removing "await",
|
|
72627
72627
|
extra.push("where: async " + where);
|
|
72628
72628
|
}
|
|
72629
|
+
const topEquals = {};
|
|
72630
|
+
for (const compare of (whereNode === null || whereNode === void 0 ? void 0 : whereNode.findDirectExpressions(abaplint.Expressions.ComponentCompare)) || []) {
|
|
72631
|
+
const op = (_c = compare.findDirectExpression(abaplint.Expressions.CompareOperator)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();
|
|
72632
|
+
if (op !== "=" && op !== "EQ") {
|
|
72633
|
+
continue;
|
|
72634
|
+
}
|
|
72635
|
+
else if (compare.findDirectTokenByText("NOT")) {
|
|
72636
|
+
continue;
|
|
72637
|
+
}
|
|
72638
|
+
const tchain = traversal.traverse(compare.findDirectExpression(abaplint.Expressions.ComponentChainSimple));
|
|
72639
|
+
const tsource = traversal.traverse(compare.findDirectExpression(abaplint.Expressions.Source));
|
|
72640
|
+
topEquals[tchain.getCode()] = tsource.getCode();
|
|
72641
|
+
}
|
|
72642
|
+
if (Object.keys(topEquals).length > 0) {
|
|
72643
|
+
const fields = [];
|
|
72644
|
+
for (const n in topEquals) {
|
|
72645
|
+
fields.push(`"${n}": ` + topEquals[n]);
|
|
72646
|
+
}
|
|
72647
|
+
extra.push("topEquals: {" + fields.join(",") + "}");
|
|
72648
|
+
}
|
|
72629
72649
|
let concat = "";
|
|
72630
72650
|
if (extra.length > 0) {
|
|
72631
72651
|
concat = ",{" + extra.join(",") + "}";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.123",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.3.
|
|
28
|
+
"@abaplint/transpiler": "^2.3.123",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|