@abaplint/runtime 2.5.16 → 2.5.17
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/src/operators/add.d.ts +2 -2
- package/build/src/operators/add.js +12 -0
- package/build/src/operators/minus.d.ts +2 -2
- package/build/src/operators/minus.js +12 -0
- package/build/src/statements/read_table.d.ts +1 -1
- package/build/src/statements/read_table.js +12 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Float, Hex, Integer } from "../types";
|
|
1
|
+
import { FieldSymbol, 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):
|
|
4
|
+
export declare function add(left: INumeric | ICharacter | string | number | Float | Integer | Hex | FieldSymbol, right: INumeric | ICharacter | string | number | Float | Integer | Hex | FieldSymbol): Integer | Float;
|
|
@@ -5,6 +5,18 @@ const types_1 = require("../types");
|
|
|
5
5
|
const string_1 = require("../types/string");
|
|
6
6
|
const _parse_1 = require("./_parse");
|
|
7
7
|
function add(left, right) {
|
|
8
|
+
if (left instanceof types_1.FieldSymbol) {
|
|
9
|
+
if (left.getPointer() === undefined) {
|
|
10
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
11
|
+
}
|
|
12
|
+
return add(left.getPointer(), right);
|
|
13
|
+
}
|
|
14
|
+
if (right instanceof types_1.FieldSymbol) {
|
|
15
|
+
if (right.getPointer() === undefined) {
|
|
16
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
17
|
+
}
|
|
18
|
+
return add(left, right.getPointer());
|
|
19
|
+
}
|
|
8
20
|
if (left instanceof types_1.Integer && right instanceof types_1.Integer) {
|
|
9
21
|
return new types_1.Integer().set(left.get() + right.get());
|
|
10
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Float, Integer } from "../types";
|
|
1
|
+
import { FieldSymbol, 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):
|
|
4
|
+
export declare function minus(left: INumeric | ICharacter | string | number | Integer | Float | FieldSymbol, right: INumeric | ICharacter | string | number | Integer | Float | FieldSymbol): Integer | Float;
|
|
@@ -5,6 +5,18 @@ const types_1 = require("../types");
|
|
|
5
5
|
const _parse_1 = require("./_parse");
|
|
6
6
|
const string_1 = require("../types/string");
|
|
7
7
|
function minus(left, right) {
|
|
8
|
+
if (left instanceof types_1.FieldSymbol) {
|
|
9
|
+
if (left.getPointer() === undefined) {
|
|
10
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
11
|
+
}
|
|
12
|
+
return minus(left.getPointer(), right);
|
|
13
|
+
}
|
|
14
|
+
if (right instanceof types_1.FieldSymbol) {
|
|
15
|
+
if (right.getPointer() === undefined) {
|
|
16
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
17
|
+
}
|
|
18
|
+
return minus(left, right.getPointer());
|
|
19
|
+
}
|
|
8
20
|
if (left instanceof types_1.Integer && right instanceof types_1.Integer) {
|
|
9
21
|
return new types_1.Integer().set(left.get() - right.get());
|
|
10
22
|
}
|
|
@@ -2,7 +2,7 @@ import { DataReference, FieldSymbol, Structure, Table } from "../types";
|
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
4
|
export interface IReadTableOptions {
|
|
5
|
-
index?: INumeric | number;
|
|
5
|
+
index?: INumeric | FieldSymbol | number;
|
|
6
6
|
withKey?: (i: any) => boolean;
|
|
7
7
|
into?: INumeric | ICharacter | Structure | Table | DataReference;
|
|
8
8
|
from?: INumeric | ICharacter | Structure | Table | DataReference;
|
|
@@ -30,7 +30,18 @@ function readTable(table, options) {
|
|
|
30
30
|
if (options === null || options === void 0 ? void 0 : options.index) {
|
|
31
31
|
let index = options.index;
|
|
32
32
|
if (typeof index !== "number") {
|
|
33
|
-
index
|
|
33
|
+
if (index instanceof types_1.FieldSymbol) {
|
|
34
|
+
if (index.getPointer() === undefined) {
|
|
35
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
36
|
+
}
|
|
37
|
+
index = index.getPointer();
|
|
38
|
+
}
|
|
39
|
+
if (index instanceof types_1.Float || index instanceof types_1.DecFloat34) {
|
|
40
|
+
index = index.getRaw();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
index = index.get();
|
|
44
|
+
}
|
|
34
45
|
}
|
|
35
46
|
found = arr[index - 1];
|
|
36
47
|
if (found) {
|