@abaplint/transpiler 2.7.129 → 2.7.130

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.
@@ -27,7 +27,7 @@ class InterfaceTranspiler {
27
27
  ret += traversal.registerClassOrInterface(def);
28
28
  }
29
29
  }
30
- ret += this.buildConstants(node.findFirstExpression(abaplint.Expressions.InterfaceName), traversal);
30
+ ret += this.buildConstants(node.findFirstExpression(abaplint.Expressions.InterfaceName), traversal, def);
31
31
  ret += this.buildTypes(def);
32
32
  return new chunk_1.Chunk(ret);
33
33
  }
@@ -42,7 +42,7 @@ class InterfaceTranspiler {
42
42
  }
43
43
  return ret;
44
44
  }
45
- buildConstants(node, traversal) {
45
+ buildConstants(node, traversal, idef) {
46
46
  if (node === undefined) {
47
47
  return "";
48
48
  }
@@ -61,6 +61,11 @@ class InterfaceTranspiler {
61
61
  const interfaceName = traversal_1.Traversal.escapeNamespace(node.getFirstToken().getStr().toLowerCase());
62
62
  const name = interfaceName + "." + interfaceName + "$" + n.toLowerCase();
63
63
  ret += name + " = " + new transpile_types_1.TranspileTypes().toType(identifier.getType()) + ";\n";
64
+ const alias = idef === null || idef === void 0 ? void 0 : idef.getAliases().getAll().find(a => a.getName().toUpperCase() === n.toUpperCase());
65
+ if (alias) {
66
+ // todo: this is an evil workaround, should be fixed in abaplint instead
67
+ ret += interfaceName + "." + alias.getComponent().split("~")[0].toLowerCase() + "$" + n.toLowerCase() + " = " + name + ";\n";
68
+ }
64
69
  const constantStatement = traversal.findStatementInFile(identifier.getStart());
65
70
  const valExpression = constantStatement === null || constantStatement === void 0 ? void 0 : constantStatement.findFirstExpression(abaplint.Expressions.Value);
66
71
  if ((valExpression === null || valExpression === void 0 ? void 0 : valExpression.getChildren()[1].get()) instanceof abaplint.Expressions.SimpleFieldChain) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.7.129",
3
+ "version": "2.7.130",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "author": "abaplint",
30
30
  "license": "MIT",
31
31
  "dependencies": {
32
- "@abaplint/core": "^2.102.67",
32
+ "@abaplint/core": "^2.102.69",
33
33
  "source-map": "^0.7.4"
34
34
  },
35
35
  "devDependencies": {