@abaplint/runtime 2.7.48 → 2.7.49

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.
@@ -22,6 +22,9 @@ function initial(val) {
22
22
  else if (val instanceof types_1.Time) {
23
23
  return val.get() === "000000";
24
24
  }
25
+ else if (val instanceof types_1.Float) {
26
+ return val.getRaw() === 0;
27
+ }
25
28
  else if (val instanceof types_1.Character) {
26
29
  return val.get().match(/^ *$/) !== null;
27
30
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shift = void 0;
4
4
  const compare_1 = require("../compare");
5
+ const types_1 = require("../types");
5
6
  function shift(target, options) {
6
7
  if ((options === null || options === void 0 ? void 0 : options.mode) === "BYTE") {
7
8
  shift_byte_mode(target, options);
@@ -67,7 +68,12 @@ function shift_character_mode(target, options) {
67
68
  else {
68
69
  value = value.substr(1);
69
70
  }
70
- target.set(value);
71
+ if (target instanceof types_1.Numc) {
72
+ target.set(value, true);
73
+ }
74
+ else {
75
+ target.set(value);
76
+ }
71
77
  }
72
78
  function shift_byte_mode(target, options) {
73
79
  let value = target.get();
@@ -10,7 +10,7 @@ export declare class Numc implements ICharacter {
10
10
  qualifiedName?: string;
11
11
  });
12
12
  getQualifiedName(): string | undefined;
13
- set(value: INumeric | ICharacter | Hex | string | number): this | undefined;
13
+ set(value: INumeric | ICharacter | Hex | string | number, raw?: boolean): this | undefined;
14
14
  getLength(): number;
15
15
  clear(): void;
16
16
  get(): string;
@@ -12,7 +12,7 @@ class Numc {
12
12
  getQualifiedName() {
13
13
  return this.qualifiedName;
14
14
  }
15
- set(value) {
15
+ set(value, raw = false) {
16
16
  if (typeof value === "number") {
17
17
  this.value = value.toString();
18
18
  }
@@ -28,7 +28,7 @@ class Numc {
28
28
  }
29
29
  else {
30
30
  const pad = this.length - this.value.length;
31
- if (pad > 0) {
31
+ if (pad > 0 && raw === false) {
32
32
  this.value = "0".repeat(pad) + this.value;
33
33
  }
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.7.48",
3
+ "version": "2.7.49",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",