@abaplint/runtime 2.7.83 → 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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
28
|
+
result += char;
|
|
36
29
|
}
|
|
30
|
+
input.set(result);
|
|
37
31
|
}
|
|
38
32
|
}
|
|
39
33
|
exports.translate = translate;
|