@abaplint/transpiler 2.11.21 → 2.11.23
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.
|
@@ -86,11 +86,7 @@ class SourceTranspiler {
|
|
|
86
86
|
ret.appendString(")");
|
|
87
87
|
}
|
|
88
88
|
else if (c.get() instanceof core_1.Expressions.ValueBody) {
|
|
89
|
-
|
|
90
|
-
if (typ === undefined) {
|
|
91
|
-
throw new Error("TypeNameOrInfer not found in ValueBody");
|
|
92
|
-
}
|
|
93
|
-
ret.appendChunk(new value_body_1.ValueBodyTranspiler().transpile(typ, c, traversal));
|
|
89
|
+
continue;
|
|
94
90
|
}
|
|
95
91
|
else {
|
|
96
92
|
ret.appendString("SourceUnknown-" + c.get().constructor.name);
|
|
@@ -107,6 +103,20 @@ class SourceTranspiler {
|
|
|
107
103
|
ret.append("abap.builtin.boolc(", c, traversal);
|
|
108
104
|
post.append(")", c, traversal);
|
|
109
105
|
}
|
|
106
|
+
else if (c instanceof core_1.Nodes.TokenNode && c.getFirstToken().getStr().toUpperCase() === "VALUE") {
|
|
107
|
+
const typ = node.findDirectExpression(core_1.Expressions.TypeNameOrInfer);
|
|
108
|
+
if (typ === undefined) {
|
|
109
|
+
throw new Error("TypeNameOrInfer not found in ValueBody");
|
|
110
|
+
}
|
|
111
|
+
const valueBody = node.findDirectExpression(core_1.Expressions.ValueBody);
|
|
112
|
+
if (valueBody) {
|
|
113
|
+
ret.appendChunk(new value_body_1.ValueBodyTranspiler().transpile(typ, valueBody, traversal));
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
const context = new _1.TypeNameOrInfer().findType(typ, traversal);
|
|
117
|
+
ret.appendString(transpile_types_1.TranspileTypes.toType(context));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
110
120
|
else if (c instanceof core_1.Nodes.TokenNode && c.getFirstToken().getStr().toUpperCase() === "REF") {
|
|
111
121
|
const infer = node.findDirectExpression(core_1.Expressions.TypeNameOrInfer);
|
|
112
122
|
if (infer?.concatTokens() !== "#") {
|
|
@@ -11,7 +11,7 @@ class ValueBodyTranspiler {
|
|
|
11
11
|
if (!(typ.get() instanceof core_1.Expressions.TypeNameOrInfer)) {
|
|
12
12
|
throw new Error("ValueBodyTranspiler, Expected TypeNameOrInfer");
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
let ret = new chunk_1.Chunk().appendString(new type_name_or_infer_1.TypeNameOrInfer().transpile(typ, traversal).getCode());
|
|
15
15
|
const context = new type_name_or_infer_1.TypeNameOrInfer().findType(typ, traversal);
|
|
16
16
|
const hasLines = body.findDirectExpression(core_1.Expressions.ValueBodyLine) !== undefined;
|
|
17
17
|
let extraFields = "";
|
|
@@ -25,6 +25,10 @@ class ValueBodyTranspiler {
|
|
|
25
25
|
extraFields += transpiled;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
else if (child.get() instanceof core_1.Expressions.ValueBase && child instanceof core_1.Nodes.ExpressionNode) {
|
|
29
|
+
const source = traversal.traverse(child.findDirectExpression(core_1.Expressions.Source));
|
|
30
|
+
ret = new chunk_1.Chunk().appendString(source.getCode() + ".clone()");
|
|
31
|
+
}
|
|
28
32
|
else if (child.get() instanceof core_1.Expressions.ValueBodyLine && child instanceof core_1.Nodes.ExpressionNode) {
|
|
29
33
|
if (!(context instanceof core_1.BasicTypes.TableType)) {
|
|
30
34
|
throw new Error("ValueBodyTranspiler, Expected BasicTypes");
|
|
@@ -33,7 +37,7 @@ class ValueBodyTranspiler {
|
|
|
33
37
|
ret.appendString(new value_body_line_1.ValueBodyLineTranspiler().transpile(rowType, child, traversal, extraFields).getCode());
|
|
34
38
|
}
|
|
35
39
|
else {
|
|
36
|
-
throw new Error("ValueBodyTranspiler, unknown " + child.get().constructor.name + " " + child.concatTokens());
|
|
40
|
+
throw new Error("ValueBodyTranspiler, unknown " + child.get().constructor.name + " \"" + child.concatTokens()) + "\"";
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
return ret;
|
package/build/src/traversal.js
CHANGED
|
@@ -621,6 +621,14 @@ this.INTERNAL_ID = abap.internalIdCounter++;\n`;
|
|
|
621
621
|
return abaplint.BasicTypes.StringType.get();
|
|
622
622
|
case "xstring":
|
|
623
623
|
return abaplint.BasicTypes.XStringType.get();
|
|
624
|
+
case "decfloat16":
|
|
625
|
+
return new abaplint.BasicTypes.DecFloat16Type();
|
|
626
|
+
case "decfloat34":
|
|
627
|
+
return new abaplint.BasicTypes.DecFloat34Type();
|
|
628
|
+
case "utclong":
|
|
629
|
+
return new abaplint.BasicTypes.UTCLongType();
|
|
630
|
+
case "int8":
|
|
631
|
+
return new abaplint.BasicTypes.Integer8Type();
|
|
624
632
|
case "d":
|
|
625
633
|
return new abaplint.BasicTypes.DateType();
|
|
626
634
|
case "t":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.23",
|
|
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.113.
|
|
32
|
+
"@abaplint/core": "^2.113.167",
|
|
33
33
|
"source-map": "^0.7.6"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|