@abaplint/transpiler-cli 2.13.75 → 2.13.76

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.
Files changed (2) hide show
  1. package/build/bundle.js +15 -7
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -103770,6 +103770,7 @@ class ComponentChainSimpleTranspiler {
103770
103770
  transpile(node, traversal) {
103771
103771
  const offset = [];
103772
103772
  let ret = new chunk_1.Chunk();
103773
+ let prefix = this.prefix;
103773
103774
  for (const c of node.getChildren()) {
103774
103775
  const type = c.get();
103775
103776
  if (type instanceof core_1.Expressions.ComponentName) {
@@ -103779,11 +103780,17 @@ class ComponentChainSimpleTranspiler {
103779
103780
  field = interfaceName + "$" + field;
103780
103781
  }
103781
103782
  field = traversal_1.Traversal.escapeNamespace(field).replace("~", "$");
103782
- ret.append(this.prefix + field, c, traversal);
103783
- this.prefix = "";
103783
+ if (traversal_1.Traversal.isBracketComponent(field)) {
103784
+ ret.append(prefix.replace(/\.$/, "") + `["${field}"]`, c, traversal);
103785
+ }
103786
+ else {
103787
+ ret.append(prefix + field, c, traversal);
103788
+ }
103789
+ prefix = "";
103784
103790
  }
103785
103791
  else if (type instanceof core_1.Expressions.ArrowOrDash) {
103786
- ret.append(".get().", c, traversal);
103792
+ ret.append(".get()", c, traversal);
103793
+ prefix = ".";
103787
103794
  }
103788
103795
  else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.FieldOffset) {
103789
103796
  offset.push("offset: " + new field_offset_1.FieldOffsetTranspiler().transpile(c, traversal).getCode());
@@ -117617,10 +117624,11 @@ class ReadTableTranspiler {
117617
117624
  const source = compare.getChildren()[(i * 3) + 2];
117618
117625
  const s = traversal.traverse(source).getCode();
117619
117626
  let field = "";
117627
+ let key = left.concatTokens().toLowerCase();
117620
117628
  if (left.get() instanceof abaplint.Expressions.Dynamic
117621
117629
  && left instanceof abaplint.Nodes.ExpressionNode) {
117622
- const concat = left.concatTokens().toLowerCase();
117623
- field = "i." + concat.substring(2, concat.length - 2);
117630
+ key = key.substring(2, key.length - 2);
117631
+ field = "i." + key;
117624
117632
  }
117625
117633
  else if (left.get() instanceof abaplint.Expressions.ComponentChainSimple
117626
117634
  && left instanceof abaplint.Nodes.ExpressionNode) {
@@ -117637,12 +117645,12 @@ class ReadTableTranspiler {
117637
117645
  prefix += "const " + id + " = " + s + ";\n";
117638
117646
  withKey.push("abap.compare.eq(" + field + ", " + id + ")");
117639
117647
  withKeyValue.push(`{key: (i) => {return ${field}}, value: ${id}}`);
117640
- withKeySimple.push(`"${field.replace("i.", "").replace(/\$/g, "/")}": ${id}`);
117648
+ withKeySimple.push(`${JSON.stringify(key)}: ${id}`);
117641
117649
  }
117642
117650
  else {
117643
117651
  withKey.push("abap.compare.eq(" + field + ", " + s + ")");
117644
117652
  withKeyValue.push(`{key: (i) => {return ${field}}, value: ${s}}`);
117645
- withKeySimple.push(`"${field.replace("i.", "").replace(/\$/g, "/")}": ${s}`);
117653
+ withKeySimple.push(`${JSON.stringify(key)}: ${s}`);
117646
117654
  }
117647
117655
  }
117648
117656
  extra.push("withKey: (i) => {return " + withKey.join(" && ") + ";}");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.13.75",
3
+ "version": "2.13.76",
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.120.42",
31
- "@abaplint/transpiler": "^2.13.75",
31
+ "@abaplint/transpiler": "^2.13.76",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.13.3",
34
34
  "@types/progress": "^2.0.7",