@abaplint/transpiler 2.10.3 → 2.10.5
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.
|
@@ -5,19 +5,24 @@ const abaplint = require("@abaplint/core");
|
|
|
5
5
|
const chunk_1 = require("../chunk");
|
|
6
6
|
class DeleteInternalTranspiler {
|
|
7
7
|
transpile(node, traversal) {
|
|
8
|
-
const target = traversal.traverse(node.
|
|
8
|
+
const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target)).getCode();
|
|
9
9
|
const concat = node.concatTokens().toUpperCase();
|
|
10
10
|
const extra = [];
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
11
|
+
const componentCond = node.findDirectExpression(abaplint.Expressions.ComponentCond);
|
|
12
|
+
if (componentCond) {
|
|
13
13
|
// todo, replacing "await" is a hack
|
|
14
|
-
extra.push("where: " + traversal.traverse(
|
|
14
|
+
extra.push("where: " + traversal.traverse(componentCond).getCode().replace("await ", ""));
|
|
15
|
+
}
|
|
16
|
+
const componentCompare = node.findDirectExpression(abaplint.Expressions.ComponentCompare);
|
|
17
|
+
if (componentCompare) {
|
|
18
|
+
// todo: this can be optimized, WITH TABLE KEY
|
|
19
|
+
extra.push("where: " + traversal.traverse(componentCompare).getCode());
|
|
15
20
|
}
|
|
16
21
|
// todo, this is not completely correct, fields might have the name ADJACENT
|
|
17
22
|
// comparisons should be on table key unless other is specified, but we're unaware
|
|
18
23
|
if (node.findDirectTokenByText("ADJACENT")) {
|
|
19
24
|
extra.push("adjacent: true");
|
|
20
|
-
if (node.findDirectTokenByText("COMPARING") && !
|
|
25
|
+
if (node.findDirectTokenByText("COMPARING") && !concat.includes("COMPARING ALL FIELDS")) {
|
|
21
26
|
const comparing = node.findAllExpressions(abaplint.Expressions.FieldSub);
|
|
22
27
|
if (comparing) {
|
|
23
28
|
const compareFields = comparing.map(i => "'" + i.getFirstToken().getStr() + "'").join(",");
|