@abaplint/transpiler 2.13.94 → 2.13.95
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.
|
@@ -148,7 +148,10 @@ class LoopTranspiler {
|
|
|
148
148
|
extra.push(`atLast: (last) => { ${this.atLast} = last; }`);
|
|
149
149
|
}
|
|
150
150
|
const topEquals = {};
|
|
151
|
-
|
|
151
|
+
// only a pure conjunction makes each top-level `=` a condition every row
|
|
152
|
+
// has to meet: `a = 1 OR b = 2` narrows by neither
|
|
153
|
+
const onlyAnd = whereNode?.getChildren().every(c => !(c instanceof abaplint.Nodes.TokenNode) || c.concatTokens().toUpperCase() !== "OR") ?? true;
|
|
154
|
+
for (const compare of onlyAnd ? whereNode?.findDirectExpressions(abaplint.Expressions.ComponentCompare) || [] : []) {
|
|
152
155
|
const op = compare.findDirectExpression(abaplint.Expressions.CompareOperator)?.concatTokens().toUpperCase();
|
|
153
156
|
if (op !== "=" && op !== "EQ") {
|
|
154
157
|
continue;
|
|
@@ -58,8 +58,12 @@ class UpdateDatabaseTranspiler {
|
|
|
58
58
|
}
|
|
59
59
|
options.push(`"set": [${s.join(",")}]`);
|
|
60
60
|
}
|
|
61
|
+
const fromTable = node.findExpressionAfterToken("TABLE");
|
|
62
|
+
if (fromTable && fromTable.get() instanceof abaplint.Expressions.SQLSource) {
|
|
63
|
+
options.push(`"table": ` + traversal.traverse(fromTable).getCode());
|
|
64
|
+
}
|
|
61
65
|
const sourceExpression = node.findDirectExpression(abaplint.Expressions.SQLSource)?.findDirectExpression(abaplint.Expressions.SimpleSource3);
|
|
62
|
-
if (sourceExpression) {
|
|
66
|
+
if (sourceExpression && fromTable === undefined) {
|
|
63
67
|
const sqlSource = new expressions_1.SourceTranspiler(true).transpile(sourceExpression, traversal).getCode();
|
|
64
68
|
const tableName = node.findDirectExpression(abaplint.Expressions.DatabaseTable)?.concatTokens();
|
|
65
69
|
const tabl = traversal.findTable(tableName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.95",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"author": "abaplint",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@abaplint/core": "^2.120.
|
|
32
|
+
"@abaplint/core": "^2.120.63",
|
|
33
33
|
"source-map": "^0.8.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/chai": "^5.2.3",
|
|
37
37
|
"@types/mocha": "^10.0.10",
|
|
38
38
|
"chai": "^6.2.2",
|
|
39
|
-
"mocha": "^12.0.
|
|
39
|
+
"mocha": "^12.0.3",
|
|
40
40
|
"source-map-support": "^0.5.21",
|
|
41
41
|
"typescript": "^6.0.3"
|
|
42
42
|
}
|