@abaplint/transpiler 2.11.18 → 2.11.19

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,6 +5,7 @@ const core_1 = require("@abaplint/core");
5
5
  const chunk_1 = require("../chunk");
6
6
  const transpile_types_1 = require("../transpile_types");
7
7
  const field_assignment_1 = require("./field_assignment");
8
+ const source_1 = require("./source");
8
9
  class ValueBodyLineTranspiler {
9
10
  transpile(rowType, line, traversal, extraFields) {
10
11
  const ret = new chunk_1.Chunk();
@@ -17,8 +18,12 @@ class ValueBodyLineTranspiler {
17
18
  else if (child.get() instanceof core_1.Expressions.FieldAssignment && child instanceof core_1.Nodes.ExpressionNode) {
18
19
  ret.appendString(new field_assignment_1.FieldAssignmentTranspiler().transpile(child, traversal).getCode());
19
20
  }
21
+ else if (child.get() instanceof core_1.Expressions.Source && child instanceof core_1.Nodes.ExpressionNode) {
22
+ // then its a non structured/ table line kind of thing
23
+ ret.appendString(".set(" + new source_1.SourceTranspiler().transpile(child, traversal).getCode() + ")");
24
+ }
20
25
  else {
21
- throw new Error("ValueBodyLineTranspiler, unknown " + child.get().constructor.name);
26
+ throw new Error("ValueBodyLineTranspiler, unknown " + child.get().constructor.name + " " + line.concatTokens());
22
27
  }
23
28
  }
24
29
  ret.appendString(extraFields + `)`);
@@ -636,6 +636,13 @@ this.INTERNAL_ID = abap.internalIdCounter++;\n`;
636
636
  if (dtel) {
637
637
  return dtel.parseType(this.reg);
638
638
  }
639
+ if (name.includes("=>")) {
640
+ const [className, typeName] = name.split("=>");
641
+ const cls = this.findClassDefinition(className, scope);
642
+ if (cls) {
643
+ return cls.getTypeDefinitions().getByName(typeName)?.getType();
644
+ }
645
+ }
639
646
  // todo: yea, well, yea
640
647
  throw new Error("lookupType, type not found, " + node.concatTokens());
641
648
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.11.18",
3
+ "version": "2.11.19",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",