@abaplint/transpiler 2.7.87 → 2.7.88

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.
@@ -64,25 +64,29 @@ class ReadTableTranspiler {
64
64
  if (left.get() instanceof abaplint.Expressions.Dynamic
65
65
  && left instanceof abaplint.Nodes.ExpressionNode) {
66
66
  const concat = left.concatTokens().toLowerCase();
67
- field = concat.substring(2, concat.length - 2);
67
+ field = "i." + concat.substring(2, concat.length - 2);
68
+ }
69
+ else if (left.get() instanceof abaplint.Expressions.ComponentChainSimple
70
+ && left instanceof abaplint.Nodes.ExpressionNode) {
71
+ field = new expressions_1.ComponentChainSimpleTranspiler("i.").transpile(left, traversal).getCode();
68
72
  }
69
73
  else {
70
- field = traversal.traverse(left).getCode();
74
+ throw new Error("transpiler: READ TABLE, unexpected node");
71
75
  }
72
- if (field === "table_line") {
76
+ if (field === "i.table_line") {
73
77
  usesTableLine = true;
74
78
  }
75
79
  if (s.includes("await")) {
76
80
  const id = unique_identifier_1.UniqueIdentifier.get();
77
81
  prefix += "const " + id + " = " + s + ";\n";
78
- withKey.push("abap.compare.eq(i." + field + ", " + id + ")");
79
- withKeyValue.push(`{key: (i) => {return i.${field}}, value: ${id}}`);
80
- withKeySimple.push(`"${field}": ${id}`);
82
+ withKey.push("abap.compare.eq(" + field + ", " + id + ")");
83
+ withKeyValue.push(`{key: (i) => {return ${field}}, value: ${id}}`);
84
+ withKeySimple.push(`"${field.replace("i.", "")}": ${id}`);
81
85
  }
82
86
  else {
83
- withKey.push("abap.compare.eq(i." + field + ", " + s + ")");
84
- withKeyValue.push(`{key: (i) => {return i.${field}}, value: ${s}}`);
85
- withKeySimple.push(`"${field}": ${s}`);
87
+ withKey.push("abap.compare.eq(" + field + ", " + s + ")");
88
+ withKeyValue.push(`{key: (i) => {return ${field}}, value: ${s}}`);
89
+ withKeySimple.push(`"${field.replace("i.", "")}": ${s}`);
86
90
  }
87
91
  }
88
92
  extra.push("withKey: (i) => {return " + withKey.join(" && ") + ";}");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.7.87",
3
+ "version": "2.7.88",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",