@abaplint/transpiler-cli 2.13.81 → 2.13.82
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.
- package/build/bundle.js +12 -4
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -113315,12 +113315,19 @@ class DataTranspiler {
|
|
|
113315
113315
|
value = "\n" + traversal_1.Traversal.prefixVariable(found.getName().toLowerCase()) + ".set(\"" + enumDefault + "\");";
|
|
113316
113316
|
}
|
|
113317
113317
|
}
|
|
113318
|
+
let packedDecimals;
|
|
113319
|
+
if (found.getType() instanceof abaplint.BasicTypes.PackedType) {
|
|
113320
|
+
const decimals = node.findFirstExpression(abaplint.Expressions.Decimals)?.findFirstExpression(abaplint.Expressions.Integer);
|
|
113321
|
+
if (decimals) {
|
|
113322
|
+
packedDecimals = parseInt(decimals.concatTokens(), 10);
|
|
113323
|
+
}
|
|
113324
|
+
}
|
|
113318
113325
|
this.variableName = traversal_1.Traversal.prefixVariable(traversal_1.Traversal.escapeNamespace(found.getName().toLowerCase()));
|
|
113319
113326
|
this.loopScoped = traversal.isInsideLoop(node);
|
|
113320
113327
|
const ret = new chunk_1.Chunk()
|
|
113321
113328
|
.appendString(this.loopScoped === true ? "var " : "let ")
|
|
113322
113329
|
.appendString(this.variableName)
|
|
113323
|
-
.appendString(" = " + transpile_types_1.TranspileTypes.toType(found.getType()))
|
|
113330
|
+
.appendString(" = " + transpile_types_1.TranspileTypes.toType(found.getType(), { packedDecimals }))
|
|
113324
113331
|
.appendString(";")
|
|
113325
113332
|
.appendString(value);
|
|
113326
113333
|
if (this.loopScoped === true && this.skipLoopScoping === false) {
|
|
@@ -122571,7 +122578,7 @@ class TranspileTypes {
|
|
|
122571
122578
|
// return singleton,
|
|
122572
122579
|
return "(() => { let _t; return () => (_t ??= " + this.toType(type) + "); })()";
|
|
122573
122580
|
}
|
|
122574
|
-
static toType(type) {
|
|
122581
|
+
static toType(type, options) {
|
|
122575
122582
|
let resolved = "";
|
|
122576
122583
|
let extra = "";
|
|
122577
122584
|
if (type instanceof abaplint.BasicTypes.ObjectReferenceType
|
|
@@ -122694,11 +122701,12 @@ class TranspileTypes {
|
|
|
122694
122701
|
}
|
|
122695
122702
|
else if (type instanceof abaplint.BasicTypes.PackedType) {
|
|
122696
122703
|
resolved = "Packed";
|
|
122704
|
+
const decimals = options?.packedDecimals ?? type.getDecimals();
|
|
122697
122705
|
if (type.getQualifiedName()) {
|
|
122698
|
-
extra = "{length: " + type.getLength() + ", decimals: " +
|
|
122706
|
+
extra = "{length: " + type.getLength() + ", decimals: " + decimals + ", qualifiedName: \"" + type.getQualifiedName() + "\"}";
|
|
122699
122707
|
}
|
|
122700
122708
|
else {
|
|
122701
|
-
extra = "{length: " + type.getLength() + ", decimals: " +
|
|
122709
|
+
extra = "{length: " + type.getLength() + ", decimals: " + decimals + "}";
|
|
122702
122710
|
}
|
|
122703
122711
|
}
|
|
122704
122712
|
else if (type instanceof abaplint.BasicTypes.NumericGenericType) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.82",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@abaplint/core": "^2.120.45",
|
|
31
|
-
"@abaplint/transpiler": "^2.13.
|
|
31
|
+
"@abaplint/transpiler": "^2.13.82",
|
|
32
32
|
"@types/glob": "^9.0.0",
|
|
33
33
|
"@types/node": "^26.4.1",
|
|
34
34
|
"@types/progress": "^2.0.7",
|