@abaplint/transpiler 2.7.129 → 2.7.131
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.
|
@@ -47,7 +47,6 @@ class MethodImplementationTranspiler {
|
|
|
47
47
|
const type = identifier.getType();
|
|
48
48
|
if (identifier.getMeta().includes("exporting" /* abaplint.IdentifierMeta.MethodExporting */)) {
|
|
49
49
|
after += `let ${varName} = ${unique}?.${varName} || ${new transpile_types_1.TranspileTypes().toType(identifier.getType())};\n`;
|
|
50
|
-
// begin new
|
|
51
50
|
}
|
|
52
51
|
else if (identifier.getMeta().includes("importing" /* abaplint.IdentifierMeta.MethodImporting */)
|
|
53
52
|
&& parameterDefault === undefined
|
|
@@ -68,7 +67,12 @@ class MethodImplementationTranspiler {
|
|
|
68
67
|
else {
|
|
69
68
|
after += `let ${varName} = ${unique}?.${varName};\n`;
|
|
70
69
|
}
|
|
71
|
-
|
|
70
|
+
if (type instanceof abaplint.BasicTypes.NumericGenericType) {
|
|
71
|
+
after += `if (${varName}.constructor.name === "Character") {
|
|
72
|
+
${varName} = ${new transpile_types_1.TranspileTypes().toType(identifier.getType())};
|
|
73
|
+
${varName}.set(${unique}?.${varName});
|
|
74
|
+
}\n`;
|
|
75
|
+
}
|
|
72
76
|
}
|
|
73
77
|
else if (identifier.getMeta().includes("importing" /* abaplint.IdentifierMeta.MethodImporting */)
|
|
74
78
|
&& type.isGeneric() === false) {
|
|
@@ -18,6 +18,10 @@ class WriteTranspiler {
|
|
|
18
18
|
if (exponent) {
|
|
19
19
|
extra.push("exponent: " + traversal.traverse(exponent).getCode());
|
|
20
20
|
}
|
|
21
|
+
const currency = node.findExpressionAfterToken("CURRENCY");
|
|
22
|
+
if (currency) {
|
|
23
|
+
extra.push("currency: " + traversal.traverse(currency).getCode());
|
|
24
|
+
}
|
|
21
25
|
if (concat.includes("NO-GROUPING")) {
|
|
22
26
|
extra.push("noGrouping: true");
|
|
23
27
|
}
|
|
@@ -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) {
|
|
@@ -148,7 +148,7 @@ class TranspileTypes {
|
|
|
148
148
|
}
|
|
149
149
|
else if (type instanceof abaplint.BasicTypes.NumericGenericType) {
|
|
150
150
|
resolved = "Packed";
|
|
151
|
-
extra = "{length: 8, decimals:
|
|
151
|
+
extra = "{length: 8, decimals: 2}";
|
|
152
152
|
}
|
|
153
153
|
else if (type instanceof abaplint.BasicTypes.XStringType) {
|
|
154
154
|
resolved = "XString";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.131",
|
|
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.
|
|
32
|
+
"@abaplint/core": "^2.103.0",
|
|
33
33
|
"source-map": "^0.7.4"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|