@abaplint/runtime 2.13.85 → 2.13.87
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.
|
@@ -153,7 +153,11 @@ function createData(target, options) {
|
|
|
153
153
|
target.assign(new types_1.DecFloat34());
|
|
154
154
|
break;
|
|
155
155
|
default:
|
|
156
|
-
if (abap.DDIC[options.typeName.trimEnd()]) {
|
|
156
|
+
if (abap.DDIC[options.typeName.trimEnd()] && options.table) {
|
|
157
|
+
// static "TYPE STANDARD TABLE OF <ddic>", same as the dynamic name variant above
|
|
158
|
+
target.assign(new abap.types.Table(abap.DDIC[options.typeName.trimEnd()].type(), tableOptions));
|
|
159
|
+
}
|
|
160
|
+
else if (abap.DDIC[options.typeName.trimEnd()]) {
|
|
157
161
|
target.assign(abap.DDIC[options.typeName.trimEnd()].type().clone());
|
|
158
162
|
}
|
|
159
163
|
else if (options.typeName.includes("=>")) {
|
|
@@ -22,7 +22,10 @@ class DecFloat34 {
|
|
|
22
22
|
this.value = 0;
|
|
23
23
|
}
|
|
24
24
|
else if (typeof value === "string") {
|
|
25
|
-
|
|
25
|
+
// get() writes the decimal separator as a comma, and parseFloat stops
|
|
26
|
+
// at one: without this, reading back what this type just wrote gives a
|
|
27
|
+
// truncated number and no error at all
|
|
28
|
+
this.value = parseFloat(value.replace(",", "."));
|
|
26
29
|
}
|
|
27
30
|
else if (value instanceof DecFloat34) {
|
|
28
31
|
this.value = value.getRaw();
|
package/build/src/types/float.js
CHANGED
|
@@ -6,7 +6,12 @@ const hex_1 = require("./hex");
|
|
|
6
6
|
const xstring_1 = require("./xstring");
|
|
7
7
|
const integer8_1 = require("./integer8");
|
|
8
8
|
const decfloat34_1 = require("./decfloat34");
|
|
9
|
-
|
|
9
|
+
// A float writes itself out with a comma for the decimal separator, so
|
|
10
|
+
// reading one back has to accept a comma. Both are allowed rather than only
|
|
11
|
+
// the comma: ABAP source literals carry a point, `CONV f( '0.25' )` is
|
|
12
|
+
// everywhere, and a separator that is legal on the way out and illegal on the
|
|
13
|
+
// way in is not a rule, it is a trap.
|
|
14
|
+
const FLOAT_DIGITS = /^\s*[+-]?(\d+[.,]?\d*|[.,]\d+)([eE][+-]?\d+)? *$/;
|
|
10
15
|
/*
|
|
11
16
|
function getNumberParts(x: number) {
|
|
12
17
|
if(isNaN(x)) {
|
|
@@ -67,7 +72,7 @@ class Float {
|
|
|
67
72
|
if (FLOAT_DIGITS.test(value) === false) {
|
|
68
73
|
(0, throw_error_1.throwError)("CX_SY_CONVERSION_NO_NUMBER");
|
|
69
74
|
}
|
|
70
|
-
this.value = parseFloat(value);
|
|
75
|
+
this.value = parseFloat(value.replace(",", "."));
|
|
71
76
|
}
|
|
72
77
|
else if (value instanceof integer8_1.Integer8) {
|
|
73
78
|
this.value = Number(value.get());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/runtime",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.87",
|
|
4
4
|
"description": "Transpiler - Runtime",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/mocha": "^10.0.10",
|
|
34
34
|
"@types/node": "^26.4.1",
|
|
35
35
|
"chai": "^6.2.2",
|
|
36
|
-
"mocha": "^12.0.
|
|
36
|
+
"mocha": "^12.0.1",
|
|
37
37
|
"source-map-support": "^0.5.21",
|
|
38
38
|
"typescript": "^6.0.3"
|
|
39
39
|
},
|