@abaplint/runtime 2.3.25 → 2.3.27

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.
@@ -8,6 +8,7 @@ export interface ICreateDataOptions {
8
8
  type?: PointerType;
9
9
  typeName?: string;
10
10
  length?: INumeric;
11
+ decimals?: INumeric;
11
12
  likeLineOf?: FieldSymbol | Table;
12
13
  like?: any;
13
14
  }
@@ -63,7 +63,11 @@ function createData(target, options) {
63
63
  if (options.length) {
64
64
  length = options.length.get();
65
65
  }
66
- target.assign(new types_1.Packed({ length: length }));
66
+ let decimals = 0;
67
+ if (options.decimals) {
68
+ decimals = options.decimals.get();
69
+ }
70
+ target.assign(new types_1.Packed({ length: length, decimals: decimals }));
67
71
  }
68
72
  break;
69
73
  case "F":
@@ -5,6 +5,7 @@ export interface IDescribeOptions {
5
5
  field: any;
6
6
  type?: ICharacter;
7
7
  length?: INumeric;
8
+ decimals?: INumeric;
8
9
  lines?: INumeric;
9
10
  table?: Table;
10
11
  mode?: "BYTE" | "CHARACTER";
@@ -59,16 +59,25 @@ function describe(input) {
59
59
  throw new Error("DESCRIBE, todo, transpiler, " + input.field.constructor.name);
60
60
  }
61
61
  }
62
+ if (input.field instanceof types_1.FieldSymbol) {
63
+ input.field = input.field.getPointer();
64
+ }
62
65
  if (input.length) {
63
- if (input.field instanceof types_1.FieldSymbol) {
64
- input.field = input.field.getPointer();
65
- }
66
66
  if (input.field instanceof types_1.Character
67
+ || input.field instanceof types_1.Packed
67
68
  || input.field instanceof types_1.Hex) {
68
69
  input.length.set(input.field.getLength());
69
70
  }
70
71
  else {
71
- throw "DESCRIBE, unsupported or todo";
72
+ throw "DESCRIBE length, unsupported or todo";
73
+ }
74
+ }
75
+ if (input.decimals) {
76
+ if (input.field instanceof types_1.Packed) {
77
+ input.decimals.set(input.field.getDecimals());
78
+ }
79
+ else {
80
+ throw "DESCRIBE decimals, unsupported or todo";
72
81
  }
73
82
  }
74
83
  if (input.table) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.3.25",
3
+ "version": "2.3.27",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",