@abaplint/runtime 2.0.68 → 2.0.71

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.
@@ -1,4 +1,4 @@
1
1
  import { Float, Hex, Integer } from "../types";
2
2
  import { ICharacter } from "../types/_character";
3
3
  import { INumeric } from "../types/_numeric";
4
- export declare function add(left: INumeric | ICharacter | string | number | Float | Integer | Hex, right: INumeric | ICharacter | string | number | Float | Integer | Hex): Integer | Float;
4
+ export declare function add(left: INumeric | ICharacter | string | number | Float | Integer | Hex, right: INumeric | ICharacter | string | number | Float | Integer | Hex): Float | Integer;
@@ -1,4 +1,4 @@
1
1
  import { Float, Integer } from "../types";
2
2
  import { ICharacter } from "../types/_character";
3
3
  import { INumeric } from "../types/_numeric";
4
- export declare function minus(left: INumeric | ICharacter | string | number | Integer | Float, right: INumeric | ICharacter | string | number | Integer | Float): Integer | Float;
4
+ export declare function minus(left: INumeric | ICharacter | string | number | Integer | Float, right: INumeric | ICharacter | string | number | Integer | Float): Float | Integer;
@@ -1,4 +1,4 @@
1
1
  import { Float, Integer } from "../types";
2
2
  import { ICharacter } from "../types/_character";
3
3
  import { INumeric } from "../types/_numeric";
4
- export declare function multiply(left: INumeric | ICharacter | string | number, right: INumeric | ICharacter | string | number): Integer | Float;
4
+ export declare function multiply(left: INumeric | ICharacter | string | number, right: INumeric | ICharacter | string | number): Float | Integer;
@@ -0,0 +1,2 @@
1
+ import { ICharacter } from "../types/_character";
2
+ export declare function getLocale(target: ICharacter): void;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLocale = void 0;
4
+ function getLocale(target) {
5
+ // todo
6
+ target.set("E");
7
+ }
8
+ exports.getLocale = getLocale;
9
+ //# sourceMappingURL=get_locale.js.map
@@ -12,6 +12,8 @@ import { describe } from "./describe";
12
12
  import { find } from "./find";
13
13
  import { cast } from "./cast";
14
14
  import { getBit } from "./get_bit";
15
+ import { getLocale } from "./get_locale";
16
+ import { setLocale } from "./set_locale";
15
17
  import { getRunTime } from "./get_run_time";
16
18
  import { getTime } from "./get_time";
17
19
  import { IInsertDatabaseOptions } from "./insert_database";
@@ -53,6 +55,7 @@ export declare class Statements {
53
55
  describe: typeof describe;
54
56
  find: typeof find;
55
57
  getBit: typeof getBit;
58
+ getLocale: typeof getLocale;
56
59
  getRunTime: typeof getRunTime;
57
60
  getTime: typeof getTime;
58
61
  insertInternal: typeof insertInternal;
@@ -63,6 +66,7 @@ export declare class Statements {
63
66
  replace: typeof replace;
64
67
  rollback: typeof rollback;
65
68
  setBit: typeof setBit;
69
+ setLocale: typeof setLocale;
66
70
  shift: typeof shift;
67
71
  sort: typeof sort;
68
72
  split: typeof split;
@@ -15,6 +15,8 @@ const describe_1 = require("./describe");
15
15
  const find_1 = require("./find");
16
16
  const cast_1 = require("./cast");
17
17
  const get_bit_1 = require("./get_bit");
18
+ const get_locale_1 = require("./get_locale");
19
+ const set_locale_1 = require("./set_locale");
18
20
  const get_run_time_1 = require("./get_run_time");
19
21
  const get_time_1 = require("./get_time");
20
22
  const insert_database_1 = require("./insert_database");
@@ -55,6 +57,7 @@ class Statements {
55
57
  this.describe = describe_1.describe;
56
58
  this.find = find_1.find;
57
59
  this.getBit = get_bit_1.getBit;
60
+ this.getLocale = get_locale_1.getLocale;
58
61
  this.getRunTime = get_run_time_1.getRunTime;
59
62
  this.getTime = get_time_1.getTime;
60
63
  this.insertInternal = insert_internal_1.insertInternal;
@@ -65,6 +68,7 @@ class Statements {
65
68
  this.replace = replace_1.replace;
66
69
  this.rollback = rollback_1.rollback;
67
70
  this.setBit = set_bit_1.setBit;
71
+ this.setLocale = set_locale_1.setLocale;
68
72
  this.shift = shift_1.shift;
69
73
  this.sort = sort_1.sort;
70
74
  this.split = split_1.split;
@@ -0,0 +1,2 @@
1
+ import { ICharacter } from "../types/_character";
2
+ export declare function setLocale(_source: ICharacter): void;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setLocale = void 0;
4
+ function setLocale(_source) {
5
+ // todo
6
+ }
7
+ exports.setLocale = setLocale;
8
+ //# sourceMappingURL=set_locale.js.map
@@ -1,9 +1,11 @@
1
+ import { Hex } from "./hex";
2
+ import { INumeric } from "./_numeric";
1
3
  export interface ICharacter {
2
4
  set(value: ICharacter | string): void;
3
5
  get(): string;
4
6
  clear(): void;
5
7
  getOffset(input: {
6
- offset?: number;
7
- length?: number;
8
+ offset?: number | INumeric | Hex;
9
+ length?: number | INumeric | Hex;
8
10
  }): ICharacter;
9
11
  }
@@ -1,4 +1,6 @@
1
+ import { Hex } from "./hex";
1
2
  import { ICharacter } from "./_character";
3
+ import { INumeric } from "./_numeric";
2
4
  export declare class Character implements ICharacter {
3
5
  private value;
4
6
  private readonly length;
@@ -13,7 +15,7 @@ export declare class Character implements ICharacter {
13
15
  clear(): void;
14
16
  get(): string;
15
17
  getOffset(input: {
16
- offset?: number;
17
- length?: number;
18
+ offset?: number | INumeric | Hex;
19
+ length?: number | INumeric | Hex;
18
20
  }): Character;
19
21
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Character = void 0;
4
+ const _parse_1 = require("../operators/_parse");
4
5
  class Character {
5
6
  constructor(input) {
6
7
  this.length = (input === null || input === void 0 ? void 0 : input.length) ? input === null || input === void 0 ? void 0 : input.length : 1;
@@ -40,6 +41,12 @@ class Character {
40
41
  return this.value;
41
42
  }
42
43
  getOffset(input) {
44
+ if (input === null || input === void 0 ? void 0 : input.offset) {
45
+ input.offset = (0, _parse_1.parse)(input.offset);
46
+ }
47
+ if (input === null || input === void 0 ? void 0 : input.length) {
48
+ input.length = (0, _parse_1.parse)(input.length);
49
+ }
43
50
  if ((input.offset && input.offset >= this.length)
44
51
  || (input.offset && input.offset < 0)
45
52
  || (input.length && input.length < 0)) {
@@ -54,9 +61,11 @@ class Character {
54
61
  }
55
62
  let ret = this.value;
56
63
  if (input === null || input === void 0 ? void 0 : input.offset) {
64
+ // @ts-ignore
57
65
  ret = ret.substr(input.offset);
58
66
  }
59
67
  if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
68
+ // @ts-ignore
60
69
  ret = ret.substr(0, input.length);
61
70
  }
62
71
  const r = new Character({ length: ret.length });
@@ -5,6 +5,7 @@ import { Table } from "./table";
5
5
  import { String } from "./string";
6
6
  import { Structure } from "./structure";
7
7
  import { Float } from "./float";
8
+ import { Hex } from "./hex";
8
9
  declare type PointerType = INumeric | Table | ICharacter | ABAPObject | undefined | Structure | Float;
9
10
  export declare class DataReference {
10
11
  private pointer;
@@ -17,10 +18,10 @@ export declare class DataReference {
17
18
  clear(): void;
18
19
  get(): any;
19
20
  array(): any;
20
- set(value: any): void | ABAPObject | ICharacter | INumeric | Float | Table | Structure;
21
+ set(value: any): void | ABAPObject | INumeric | ICharacter | Float | Table | Structure;
21
22
  getOffset(input: {
22
- offset: number;
23
- length: number;
23
+ offset?: number | INumeric | Hex;
24
+ length?: number | INumeric | Hex;
24
25
  }): String;
25
26
  }
26
27
  export {};
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DataReference = void 0;
4
4
  const string_1 = require("./string");
5
+ const _parse_1 = require("../operators/_parse");
5
6
  class DataReference {
6
7
  constructor(type) {
7
8
  this.pointer = undefined;
@@ -47,6 +48,12 @@ class DataReference {
47
48
  }
48
49
  }
49
50
  getOffset(input) {
51
+ if (input === null || input === void 0 ? void 0 : input.offset) {
52
+ input.offset = (0, _parse_1.parse)(input.offset);
53
+ }
54
+ if (input === null || input === void 0 ? void 0 : input.length) {
55
+ input.length = (0, _parse_1.parse)(input.length);
56
+ }
50
57
  // Assuming we're interested in Strings here, for now...
51
58
  let ret = this.get();
52
59
  if (input === null || input === void 0 ? void 0 : input.offset) {
@@ -10,7 +10,7 @@ export declare class Date implements ICharacter {
10
10
  get(): string;
11
11
  getNumeric(): number;
12
12
  getOffset(input: {
13
- offset: number;
14
- length: number;
13
+ offset?: number | INumeric | Hex;
14
+ length?: number | INumeric | Hex;
15
15
  }): String;
16
16
  }
@@ -4,6 +4,7 @@ exports.Date = void 0;
4
4
  const string_1 = require("./string");
5
5
  const _javascript_date_1 = require("./_javascript_date");
6
6
  const float_1 = require("./float");
7
+ const _parse_1 = require("../operators/_parse");
7
8
  class Date {
8
9
  constructor() {
9
10
  this.clear();
@@ -38,11 +39,19 @@ class Date {
38
39
  return (0, _javascript_date_1.getNumberFromDate)(this.value);
39
40
  }
40
41
  getOffset(input) {
42
+ if (input === null || input === void 0 ? void 0 : input.offset) {
43
+ input.offset = (0, _parse_1.parse)(input.offset);
44
+ }
45
+ if (input === null || input === void 0 ? void 0 : input.length) {
46
+ input.length = (0, _parse_1.parse)(input.length);
47
+ }
41
48
  let ret = this.value;
42
49
  if (input === null || input === void 0 ? void 0 : input.offset) {
50
+ // @ts-ignore
43
51
  ret = ret.substr(input.offset);
44
52
  }
45
53
  if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
54
+ // @ts-ignore
46
55
  ret = ret.substr(0, input.length);
47
56
  }
48
57
  const r = new string_1.String();
@@ -4,6 +4,7 @@ import { ABAPObject } from "./abap_object";
4
4
  import { Table } from "./table";
5
5
  import { String } from "./string";
6
6
  import { Structure } from "./structure";
7
+ import { Hex } from "./hex";
7
8
  declare type PointerType = INumeric | Table | ICharacter | ABAPObject | undefined | Structure;
8
9
  export declare class FieldSymbol {
9
10
  private pointer;
@@ -21,8 +22,8 @@ export declare class FieldSymbol {
21
22
  array(): any;
22
23
  set(value: any): this;
23
24
  getOffset(input: {
24
- offset: number;
25
- length: number;
25
+ offset?: number | INumeric | Hex;
26
+ length?: number | INumeric | Hex;
26
27
  }): String;
27
28
  }
28
29
  export {};
@@ -4,6 +4,7 @@ exports.FieldSymbol = void 0;
4
4
  const table_1 = require("./table");
5
5
  const string_1 = require("./string");
6
6
  const hex_1 = require("./hex");
7
+ const _parse_1 = require("../operators/_parse");
7
8
  class FieldSymbol {
8
9
  constructor(type) {
9
10
  this.pointer = undefined;
@@ -70,6 +71,12 @@ class FieldSymbol {
70
71
  return this;
71
72
  }
72
73
  getOffset(input) {
74
+ if (input === null || input === void 0 ? void 0 : input.offset) {
75
+ input.offset = (0, _parse_1.parse)(input.offset);
76
+ }
77
+ if (input === null || input === void 0 ? void 0 : input.length) {
78
+ input.length = (0, _parse_1.parse)(input.length);
79
+ }
73
80
  // Assuming we're interested in Strings here, for now...
74
81
  let ret = this.get();
75
82
  if (input === null || input === void 0 ? void 0 : input.offset) {
@@ -14,7 +14,7 @@ export declare class Hex implements ICharacter {
14
14
  clear(): void;
15
15
  get(): string;
16
16
  getOffset(input: {
17
- offset: number;
18
- length: number;
17
+ offset?: number | INumeric | Hex;
18
+ length?: number | INumeric | Hex;
19
19
  }): XString;
20
20
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Hex = void 0;
4
+ const _parse_1 = require("../operators/_parse");
4
5
  const float_1 = require("./float");
5
6
  const xstring_1 = require("./xstring");
6
7
  class Hex {
@@ -56,11 +57,19 @@ class Hex {
56
57
  return this.value;
57
58
  }
58
59
  getOffset(input) {
60
+ if (input === null || input === void 0 ? void 0 : input.offset) {
61
+ input.offset = (0, _parse_1.parse)(input.offset);
62
+ }
63
+ if (input === null || input === void 0 ? void 0 : input.length) {
64
+ input.length = (0, _parse_1.parse)(input.length);
65
+ }
59
66
  let ret = this.value;
60
67
  if (input === null || input === void 0 ? void 0 : input.offset) {
68
+ // @ts-ignore
61
69
  ret = ret.substr(input.offset * 2);
62
70
  }
63
71
  if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
72
+ // @ts-ignore
64
73
  ret = ret.substr(0, input.length * 2);
65
74
  }
66
75
  const r = new xstring_1.XString();
@@ -1,4 +1,6 @@
1
+ import { Hex } from "./hex";
1
2
  import { ICharacter } from "./_character";
3
+ import { INumeric } from "./_numeric";
2
4
  export declare class String implements ICharacter {
3
5
  private value;
4
6
  constructor();
@@ -6,7 +8,7 @@ export declare class String implements ICharacter {
6
8
  clear(): void;
7
9
  get(): string;
8
10
  getOffset(input: {
9
- offset: number;
10
- length: number;
11
+ offset?: number | INumeric | Hex;
12
+ length?: number | INumeric | Hex;
11
13
  }): String;
12
14
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.String = void 0;
4
+ const _parse_1 = require("../operators/_parse");
4
5
  const character_1 = require("./character");
5
6
  const integer_1 = require("./integer");
6
7
  class String {
@@ -34,6 +35,12 @@ class String {
34
35
  return this.value;
35
36
  }
36
37
  getOffset(input) {
38
+ if (input === null || input === void 0 ? void 0 : input.offset) {
39
+ input.offset = (0, _parse_1.parse)(input.offset);
40
+ }
41
+ if (input === null || input === void 0 ? void 0 : input.length) {
42
+ input.length = (0, _parse_1.parse)(input.length);
43
+ }
37
44
  if ((input.offset && input.offset > this.value.length)
38
45
  || (input.offset && input.offset < 0)
39
46
  || (input.length && input.length < 0)) {
@@ -48,9 +55,11 @@ class String {
48
55
  }
49
56
  let ret = this.value;
50
57
  if (input === null || input === void 0 ? void 0 : input.offset) {
58
+ // @ts-ignore
51
59
  ret = ret.substr(input.offset);
52
60
  }
53
61
  if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
62
+ // @ts-ignore
54
63
  ret = ret.substr(0, input.length);
55
64
  }
56
65
  const r = new String();
@@ -10,7 +10,7 @@ export declare class Time implements ICharacter {
10
10
  get(): string;
11
11
  getNumeric(): number;
12
12
  getOffset(input: {
13
- offset: number;
14
- length: number;
13
+ offset?: number | INumeric | Hex;
14
+ length?: number | INumeric | Hex;
15
15
  }): String;
16
16
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Time = void 0;
4
4
  const string_1 = require("./string");
5
5
  const _1 = require(".");
6
+ const _parse_1 = require("../operators/_parse");
6
7
  class Time {
7
8
  constructor() {
8
9
  this.clear();
@@ -39,11 +40,19 @@ class Time {
39
40
  return hours * 3600 + minutes * 60 + seconds;
40
41
  }
41
42
  getOffset(input) {
43
+ if (input === null || input === void 0 ? void 0 : input.offset) {
44
+ input.offset = (0, _parse_1.parse)(input.offset);
45
+ }
46
+ if (input === null || input === void 0 ? void 0 : input.length) {
47
+ input.length = (0, _parse_1.parse)(input.length);
48
+ }
42
49
  let ret = this.value;
43
50
  if (input === null || input === void 0 ? void 0 : input.offset) {
51
+ // @ts-ignore
44
52
  ret = ret.substr(input.offset);
45
53
  }
46
54
  if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
55
+ // @ts-ignore
47
56
  ret = ret.substr(0, input.length);
48
57
  }
49
58
  const r = new string_1.String();
@@ -6,7 +6,7 @@ class UTCLong {
6
6
  this.clear();
7
7
  }
8
8
  getOffset(_input) {
9
- throw new Error("Method not implemented.");
9
+ throw new Error("Method not implemented, getOffset(), utcLong");
10
10
  }
11
11
  set(_value) {
12
12
  // todo
@@ -1,3 +1,4 @@
1
+ import { Hex } from "./hex";
1
2
  import { ICharacter } from "./_character";
2
3
  import { INumeric } from "./_numeric";
3
4
  export declare class XString implements ICharacter {
@@ -7,7 +8,7 @@ export declare class XString implements ICharacter {
7
8
  clear(): void;
8
9
  get(): string;
9
10
  getOffset(input: {
10
- offset: number;
11
- length: number;
11
+ offset?: number | INumeric | Hex;
12
+ length?: number | INumeric | Hex;
12
13
  }): XString;
13
14
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.XString = void 0;
4
+ const _parse_1 = require("../operators/_parse");
4
5
  class XString {
5
6
  constructor() {
6
7
  this.value = "";
@@ -30,11 +31,19 @@ class XString {
30
31
  return this.value;
31
32
  }
32
33
  getOffset(input) {
34
+ if (input === null || input === void 0 ? void 0 : input.offset) {
35
+ input.offset = (0, _parse_1.parse)(input.offset);
36
+ }
37
+ if (input === null || input === void 0 ? void 0 : input.length) {
38
+ input.length = (0, _parse_1.parse)(input.length);
39
+ }
33
40
  let ret = this.value;
34
41
  if (input === null || input === void 0 ? void 0 : input.offset) {
42
+ // @ts-ignore
35
43
  ret = ret.substr(input.offset * 2);
36
44
  }
37
45
  if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
46
+ // @ts-ignore
38
47
  ret = ret.substr(0, input.length * 2);
39
48
  }
40
49
  const r = new XString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.0.68",
3
+ "version": "2.0.71",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",