@abaplint/transpiler 2.1.31 → 2.1.34

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.
@@ -17,7 +17,9 @@ class ClassImplementationTranspiler {
17
17
  else if (def === null || def === void 0 ? void 0 : def.getSuperClass()) {
18
18
  ret += " extends " + ((_a = def === null || def === void 0 ? void 0 : def.getSuperClass()) === null || _a === void 0 ? void 0 : _a.toLowerCase());
19
19
  }
20
- return new chunk_1.Chunk().append(ret + " {", node, traversal);
20
+ return new chunk_1.Chunk().append(ret + ` {
21
+ static INTERNAL_TYPE = 'CLAS';
22
+ static IMPLEMENTED_INTERFACES = [${def === null || def === void 0 ? void 0 : def.getImplementing().map(e => `"` + e.name.toUpperCase() + `"`).join(",")}];`, node, traversal);
21
23
  }
22
24
  }
23
25
  exports.ClassImplementationTranspiler = ClassImplementationTranspiler;
@@ -22,6 +22,7 @@ class ClassDefinitionTranspiler {
22
22
  // its an abstract class with only abstract methods
23
23
  return new chunk_1.Chunk(`
24
24
  class ${className === null || className === void 0 ? void 0 : className.toLowerCase()} {
25
+ static INTERNAL_TYPE = 'CLAS';
25
26
  async constructor_() {
26
27
  this.me = new abap.types.ABAPObject();
27
28
  this.me.set(this);
@@ -12,14 +12,16 @@ class InterfaceTranspiler {
12
12
  let ret = "";
13
13
  let name;
14
14
  for (const c of node.getChildren()) {
15
+ const def = traversal.getInterfaceDefinition(node.getFirstToken());
15
16
  if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.Interface) {
16
17
  name = (_a = c.findDirectExpression(abaplint.Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toLowerCase();
17
18
  name = traversal_1.Traversal.escapeClassName(name);
18
19
  ret += `class ${name} {\n`;
20
+ ret += `static INTERNAL_TYPE = 'INTF';\n`;
21
+ ret += `static IMPLEMENTED_INTERFACES = [${def === null || def === void 0 ? void 0 : def.getImplementing().map(e => `"` + e.name.toUpperCase() + `"`).join(",")}];\n`;
19
22
  }
20
23
  else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndInterface) {
21
24
  ret += "}\n";
22
- const def = traversal.getInterfaceDefinition(node.getFirstToken());
23
25
  ret += traversal.registerClassOrInterface(def);
24
26
  }
25
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.1.31",
3
+ "version": "2.1.34",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",