@abaplint/runtime 2.0.36 → 2.0.39
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.
|
@@ -7,6 +7,7 @@ class WriteStatement {
|
|
|
7
7
|
this.context = context;
|
|
8
8
|
}
|
|
9
9
|
write(source, options) {
|
|
10
|
+
var _a;
|
|
10
11
|
if ((options === null || options === void 0 ? void 0 : options.skipLine) === true) {
|
|
11
12
|
this.context.console.add("\n");
|
|
12
13
|
}
|
|
@@ -14,30 +15,39 @@ class WriteStatement {
|
|
|
14
15
|
if ((options === null || options === void 0 ? void 0 : options.newLine) === true && this.context.console.get().length > 0) {
|
|
15
16
|
this.context.console.add("\n");
|
|
16
17
|
}
|
|
18
|
+
let result = "";
|
|
17
19
|
if (typeof source === "string" || typeof source === "number") {
|
|
18
|
-
|
|
19
|
-
options.target.set(source.toString());
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
this.context.console.add(source.toString());
|
|
23
|
-
}
|
|
20
|
+
result = source.toString();
|
|
24
21
|
}
|
|
25
|
-
else {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
abap.statements.write(obj[f]);
|
|
31
|
-
}
|
|
22
|
+
else if (source instanceof types_1.Structure) {
|
|
23
|
+
const obj = source.get();
|
|
24
|
+
for (const f in obj) {
|
|
25
|
+
this.write(obj[f], Object.assign({}, options));
|
|
32
26
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
}
|
|
28
|
+
else if (source instanceof types_1.Float) {
|
|
29
|
+
if (((_a = options === null || options === void 0 ? void 0 : options.exponent) === null || _a === void 0 ? void 0 : _a.get()) === 0) {
|
|
30
|
+
const tens = source.getRaw().toFixed(0).length - 1;
|
|
31
|
+
if (options.noSign === true && source.getRaw() < 0) {
|
|
32
|
+
result = source.getRaw().toFixed(17 - tens).replace(".", ",");
|
|
33
|
+
result = result.replace("-", "");
|
|
36
34
|
}
|
|
37
35
|
else {
|
|
38
|
-
|
|
36
|
+
result = source.getRaw().toFixed(16 - tens).replace(".", ",");
|
|
39
37
|
}
|
|
40
38
|
}
|
|
39
|
+
else {
|
|
40
|
+
result = source.get().toString();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
result = source.get().toString();
|
|
45
|
+
}
|
|
46
|
+
if (options === null || options === void 0 ? void 0 : options.target) {
|
|
47
|
+
options.target.set(result);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.context.console.add(result);
|
|
41
51
|
}
|
|
42
52
|
}
|
|
43
53
|
}
|
package/build/src/types/table.js
CHANGED