@abaplint/transpiler 2.3.24 → 2.3.25

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.
@@ -62,10 +62,10 @@ class ClassImplementationTranspiler {
62
62
  if (cdef === undefined) {
63
63
  return "ERROR_CDEF_NOT_FOUND";
64
64
  }
65
- const prefix = traversal_1.Traversal.escapeClassName(cdef.getName()) + ".";
65
+ const prefix = traversal_1.Traversal.escapeClassName(cdef.getName().toLowerCase()) + ".";
66
66
  let ret = "";
67
67
  for (const ty of cdef.getTypeDefinitions().getAll()) {
68
- ret += new transpile_types_1.TranspileTypes().declareStatic(prefix, ty.type);
68
+ ret += new transpile_types_1.TranspileTypes().declareStaticSkipVoid(prefix, ty.type);
69
69
  }
70
70
  return ret;
71
71
  }
@@ -33,10 +33,10 @@ class InterfaceTranspiler {
33
33
  if (idef === undefined) {
34
34
  return "";
35
35
  }
36
- const prefix = traversal_1.Traversal.escapeClassName(idef.getName()) + ".";
36
+ const prefix = traversal_1.Traversal.escapeClassName(idef.getName().toLowerCase()) + ".";
37
37
  let ret = "";
38
38
  for (const ty of idef.getTypeDefinitions().getAll()) {
39
- ret += new transpile_types_1.TranspileTypes().declareStatic(prefix, ty.type);
39
+ ret += new transpile_types_1.TranspileTypes().declareStaticSkipVoid(prefix, ty.type);
40
40
  }
41
41
  return ret;
42
42
  }
@@ -1,6 +1,6 @@
1
1
  import * as abaplint from "@abaplint/core";
2
2
  export declare class TranspileTypes {
3
3
  declare(t: abaplint.TypedIdentifier): string;
4
- declareStatic(pre: string, t: abaplint.TypedIdentifier): string;
4
+ declareStaticSkipVoid(pre: string, t: abaplint.TypedIdentifier): string;
5
5
  toType(type: abaplint.AbstractType): string;
6
6
  }
@@ -7,9 +7,14 @@ class TranspileTypes {
7
7
  const type = t.getType();
8
8
  return "let " + t.getName().toLowerCase() + " = " + this.toType(type) + ";";
9
9
  }
10
- declareStatic(pre, t) {
10
+ declareStaticSkipVoid(pre, t) {
11
11
  const type = t.getType();
12
- return pre + t.getName().toLowerCase() + " = " + this.toType(type) + ";";
12
+ const code = this.toType(type);
13
+ // todo, this should look at the configuration, for runtime vs compile time errors
14
+ if (code.includes("Void type") || code.includes("abap.types.typeTodo")) {
15
+ return "";
16
+ }
17
+ return pre + t.getName().toLowerCase() + " = " + code + ";\n";
13
18
  }
14
19
  toType(type) {
15
20
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.3.24",
3
+ "version": "2.3.25",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",