@abaplint/transpiler 2.1.88 → 2.1.89
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.
|
@@ -18,9 +18,9 @@ class ConstantTranspiler {
|
|
|
18
18
|
}
|
|
19
19
|
return new chunk_1.Chunk().append(ret, node, traversal);
|
|
20
20
|
}
|
|
21
|
-
let str = node.
|
|
21
|
+
let str = node.findDirectExpression(core_1.Expressions.ConstantString);
|
|
22
22
|
if (str === undefined) {
|
|
23
|
-
str = node.
|
|
23
|
+
str = node.findDirectExpression(core_1.Expressions.TextElementString);
|
|
24
24
|
}
|
|
25
25
|
if (str) {
|
|
26
26
|
let res = str.getFirstToken().getStr();
|
|
@@ -40,6 +40,30 @@ class ConstantTranspiler {
|
|
|
40
40
|
return new chunk_1.Chunk().append(code, node, traversal);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
const concat = node.findDirectExpression(core_1.Expressions.ConcatenatedConstant);
|
|
44
|
+
if (concat) {
|
|
45
|
+
const chunk = new chunk_1.Chunk().appendString("abap.operators.concat([");
|
|
46
|
+
let first = true;
|
|
47
|
+
for (const child of concat.getChildren()) {
|
|
48
|
+
const res = child.getFirstToken().getStr();
|
|
49
|
+
if (first === true) {
|
|
50
|
+
first = false;
|
|
51
|
+
}
|
|
52
|
+
else if (res !== "&") {
|
|
53
|
+
chunk.appendString(",");
|
|
54
|
+
}
|
|
55
|
+
if (res.startsWith("'") && this.addGet === false) {
|
|
56
|
+
const code = "new abap.types.Character({length: " + (res.length - 2) + "}).set(" + this.escape(res) + ")";
|
|
57
|
+
chunk.append(code, node, traversal);
|
|
58
|
+
}
|
|
59
|
+
else if (res.startsWith("`") && this.addGet === false) {
|
|
60
|
+
const code = "new abap.types.String().set(" + this.escape(res) + ")";
|
|
61
|
+
chunk.append(code, node, traversal);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
chunk.appendString("])");
|
|
65
|
+
return chunk;
|
|
66
|
+
}
|
|
43
67
|
return new chunk_1.Chunk(`todo, Constant`);
|
|
44
68
|
}
|
|
45
69
|
escape(str) {
|