@abaplint/transpiler 2.5.28 → 2.5.30
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.
|
@@ -10,7 +10,7 @@ class PerformTranspiler {
|
|
|
10
10
|
return new chunk_1.Chunk(`throw new Error("PerformTranspiler FormName not found");`);
|
|
11
11
|
}
|
|
12
12
|
// todo, parameters
|
|
13
|
-
if (node.concatTokens().includes(" IN PROGRAM ")) {
|
|
13
|
+
if (node.concatTokens().toUpperCase().includes(" IN PROGRAM ")) {
|
|
14
14
|
return new chunk_1.Chunk(`throw new Error("PerformTranspiler IN PROGRAM, transpiler todo");`);
|
|
15
15
|
}
|
|
16
16
|
return new chunk_1.Chunk("await " + formName.concatTokens() + "();");
|
|
@@ -32,7 +32,7 @@ class ClassImplementationTranspiler {
|
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
34
|
/** Finds static attributes + constants including those from interfaces (from superclass is ingored) */
|
|
35
|
-
findStaticAttributes(cdef, scope) {
|
|
35
|
+
findStaticAttributes(cdef, scope, traversal) {
|
|
36
36
|
const ret = [];
|
|
37
37
|
ret.push(...cdef.getAttributes().getStatic().map(a => { return { identifier: a, prefix: "" }; }));
|
|
38
38
|
ret.push(...cdef.getAttributes().getConstants().map(a => { return { identifier: a, prefix: "" }; }));
|
|
@@ -42,14 +42,17 @@ class ClassImplementationTranspiler {
|
|
|
42
42
|
if (i === undefined) {
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
|
-
const intf =
|
|
45
|
+
const intf = traversal.findInterfaceDefinition(i.name, scope);
|
|
46
46
|
if (intf === undefined) {
|
|
47
47
|
continue;
|
|
48
48
|
}
|
|
49
|
-
// todo, constants from interface?
|
|
50
49
|
implementing.push(...intf.getImplementing());
|
|
51
|
-
ret.push(...intf.getAttributes().getStatic().map(a => {
|
|
52
|
-
|
|
50
|
+
ret.push(...intf.getAttributes().getStatic().map(a => {
|
|
51
|
+
return { identifier: a, prefix: intf.getName().toLowerCase() + "$" };
|
|
52
|
+
}));
|
|
53
|
+
ret.push(...intf.getAttributes().getConstants().map(a => {
|
|
54
|
+
return { identifier: a, prefix: intf.getName().toLowerCase() + "$" };
|
|
55
|
+
}));
|
|
53
56
|
}
|
|
54
57
|
return ret;
|
|
55
58
|
}
|
|
@@ -83,7 +86,7 @@ class ClassImplementationTranspiler {
|
|
|
83
86
|
}
|
|
84
87
|
let ret = "";
|
|
85
88
|
const clasName = node.getFirstToken().getStr().toLowerCase();
|
|
86
|
-
const staticAttributes = this.findStaticAttributes(cdef, scope);
|
|
89
|
+
const staticAttributes = this.findStaticAttributes(cdef, scope, traversal);
|
|
87
90
|
for (const attr of staticAttributes) {
|
|
88
91
|
const name = traversal_1.Traversal.escapeNamespace(clasName) + "." + traversal_1.Traversal.escapeNamespace(attr.prefix) + traversal_1.Traversal.escapeNamespace(attr.identifier.getName().toLowerCase());
|
|
89
92
|
ret += name + " = " + new transpile_types_1.TranspileTypes().toType(attr.identifier.getType()) + ";\n";
|
|
@@ -79,6 +79,12 @@ class TranspileTypes {
|
|
|
79
79
|
if (type.getQualifiedName() !== undefined) {
|
|
80
80
|
extra += ", \"" + type.getQualifiedName() + "\"";
|
|
81
81
|
}
|
|
82
|
+
else {
|
|
83
|
+
extra += ", undefined";
|
|
84
|
+
}
|
|
85
|
+
if (type.getDDICName() !== undefined) {
|
|
86
|
+
extra += ", \"" + type.getQualifiedName() + "\"";
|
|
87
|
+
}
|
|
82
88
|
}
|
|
83
89
|
else if (type instanceof abaplint.BasicTypes.CLikeType
|
|
84
90
|
|| type instanceof abaplint.BasicTypes.CSequenceType) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.30",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"author": "abaplint",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@abaplint/core": "^2.95.
|
|
31
|
+
"@abaplint/core": "^2.95.39",
|
|
32
32
|
"source-map": "^0.7.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|