@abaplint/transpiler 2.10.2 → 2.10.4

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.findFirstExpression(abaplint.Expressions.Target)).getCode();
8
+ const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target)).getCode();
9
9
  const concat = node.concatTokens().toUpperCase();
10
10
  const extra = [];
11
- const where = node.findFirstExpression(abaplint.Expressions.ComponentCond);
12
- if (where) {
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(where).getCode().replace("await ", ""));
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") && !node.concatTokens().toUpperCase().includes("COMPARING ALL FIELDS")) {
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(",");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.10.2",
3
+ "version": "2.10.4",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",