@abaplint/runtime 2.7.82 → 2.7.84

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
- import { Integer } from "../types";
1
+ import { Integer, Integer8 } from "../types";
2
2
  import { ICharacter } from "../types/_character";
3
3
  import { INumeric } from "../types/_numeric";
4
- export declare function div(left: INumeric | ICharacter | string | number, right: INumeric | ICharacter | string | number): Integer;
4
+ export declare function div(left: INumeric | ICharacter | string | number, right: INumeric | ICharacter | string | number): Integer | Integer8;
@@ -6,8 +6,12 @@ const _parse_1 = require("./_parse");
6
6
  function div(left, right) {
7
7
  const l = (0, _parse_1.parse)(left);
8
8
  const r = (0, _parse_1.parse)(right);
9
- const ret = new types_1.Integer().set(Math.floor(l / r));
10
- return ret;
9
+ if (left instanceof types_1.Integer8 || right instanceof types_1.Integer8) {
10
+ return new types_1.Integer8().set(Math.floor(l / r));
11
+ }
12
+ else {
13
+ return new types_1.Integer().set(Math.floor(l / r));
14
+ }
11
15
  }
12
16
  exports.div = div;
13
17
  //# sourceMappingURL=div.js.map
@@ -1,4 +1,4 @@
1
- import { Integer } from "../types";
1
+ import { Integer, Integer8 } from "../types";
2
2
  import { ICharacter } from "../types/_character";
3
3
  import { INumeric } from "../types/_numeric";
4
- export declare function mod(left: INumeric | ICharacter | string | number, right: INumeric | ICharacter | string | number): Integer;
4
+ export declare function mod(left: INumeric | ICharacter | string | number, right: INumeric | ICharacter | string | number): Integer | Integer8;
@@ -6,8 +6,12 @@ const _parse_1 = require("./_parse");
6
6
  function mod(left, right) {
7
7
  const l = (0, _parse_1.parse)(left);
8
8
  const r = (0, _parse_1.parse)(right);
9
- const ret = new types_1.Integer().set(((l % r) + r) % r);
10
- return ret;
9
+ if (left instanceof types_1.Integer8 || right instanceof types_1.Integer8) {
10
+ return new types_1.Integer8().set(((l % r) + r) % r);
11
+ }
12
+ else {
13
+ return new types_1.Integer().set(((l % r) + r) % r);
14
+ }
11
15
  }
12
16
  exports.mod = mod;
13
17
  //# sourceMappingURL=mod.js.map
@@ -14,26 +14,20 @@ function translate(input, i) {
14
14
  }
15
15
  else {
16
16
  const chunks = c.match(/.{1,2}/g);
17
- for (const chunk of chunks || []) {
18
- let search = chunk.substr(0, 1);
19
- const replace = chunk.substr(1, 1);
20
- // regexp escaping
21
- if (search === "+"
22
- || search === "*"
23
- || search === "?"
24
- || search === "."
25
- || search === "^"
26
- || search === "$"
27
- || search === "|"
28
- || search === "["
29
- || search === "]"
30
- || search === "\\"
31
- || search === "("
32
- || search === ")") {
33
- search = "\\" + search;
17
+ const characters = input.get().split("");
18
+ let result = "";
19
+ for (let char of characters) {
20
+ for (const chunk of chunks || []) {
21
+ const search = chunk.substr(0, 1);
22
+ const replace = chunk.substr(1, 1);
23
+ if (char === search) {
24
+ char = replace;
25
+ break;
26
+ }
34
27
  }
35
- input.set(input.get().replace(new RegExp(search, "g"), replace));
28
+ result += char;
36
29
  }
30
+ input.set(result);
37
31
  }
38
32
  }
39
33
  exports.translate = translate;
@@ -47,6 +47,11 @@ class Integer {
47
47
  else {
48
48
  this.set(value.get());
49
49
  }
50
+ /*
51
+ if (this.value > 2147483647 || this.value < -2147483648) {
52
+ throwError("CX_SY_ARITHMETIC_OVERFLOW");
53
+ }
54
+ */
50
55
  return this;
51
56
  }
52
57
  clear() {
@@ -42,7 +42,6 @@ interface ITable {
42
42
  set(tab: Table | HashedTable | TableRowType): ITable;
43
43
  getHeader(): TableRowType;
44
44
  }
45
- export declare let featureHashedTables: boolean;
46
45
  export declare class TableFactory {
47
46
  static construct(rowType: TableRowType, options?: ITableOptions, qualifiedName?: string): Table | HashedTable;
48
47
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Table = exports.HashedTable = exports.TableFactory = exports.featureHashedTables = exports.LoopController = exports.TableKeyType = exports.TableAccessType = void 0;
3
+ exports.Table = exports.HashedTable = exports.TableFactory = exports.LoopController = exports.TableKeyType = exports.TableAccessType = void 0;
4
4
  const integer_1 = require("./integer");
5
5
  const string_1 = require("./string");
6
6
  const clone_1 = require("../clone");
@@ -31,8 +31,6 @@ class LoopController {
31
31
  }
32
32
  }
33
33
  exports.LoopController = LoopController;
34
- // eslint-disable-next-line prefer-const
35
- exports.featureHashedTables = true;
36
34
  class TableFactory {
37
35
  static construct(rowType, options, qualifiedName) {
38
36
  var _a;
@@ -48,7 +46,7 @@ class TableFactory {
48
46
  withHeader: false,
49
47
  };
50
48
  }
51
- if (exports.featureHashedTables === true && ((_a = options.primaryKey) === null || _a === void 0 ? void 0 : _a.type) === TableAccessType.hashed) {
49
+ if (((_a = options.primaryKey) === null || _a === void 0 ? void 0 : _a.type) === TableAccessType.hashed) {
52
50
  return new HashedTable(rowType, options, qualifiedName);
53
51
  }
54
52
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.7.82",
3
+ "version": "2.7.84",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",