@abaplint/runtime 2.1.86 → 2.1.88
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/compare/index.d.ts +3 -0
- package/build/src/compare/index.js +3 -0
- package/build/src/compare/m.d.ts +3 -0
- package/build/src/compare/m.js +38 -0
- package/build/src/compare/o.d.ts +2 -0
- package/build/src/compare/o.js +29 -0
- package/build/src/compare/z.d.ts +2 -0
- package/build/src/compare/z.js +29 -0
- package/package.json +1 -1
|
@@ -28,6 +28,9 @@ __exportStar(require("./gt"), exports);
|
|
|
28
28
|
__exportStar(require("./initial"), exports);
|
|
29
29
|
__exportStar(require("./le"), exports);
|
|
30
30
|
__exportStar(require("./lt"), exports);
|
|
31
|
+
__exportStar(require("./o"), exports);
|
|
32
|
+
__exportStar(require("./z"), exports);
|
|
33
|
+
__exportStar(require("./m"), exports);
|
|
31
34
|
__exportStar(require("./ne"), exports);
|
|
32
35
|
__exportStar(require("./na"), exports);
|
|
33
36
|
__exportStar(require("./ns"), exports);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.m = exports.hexToBinary = void 0;
|
|
4
|
+
function hexToBinary(input) {
|
|
5
|
+
let ret = "";
|
|
6
|
+
const hex = input.get();
|
|
7
|
+
for (let index = 0; index < hex.length / 2; index++) {
|
|
8
|
+
const byte = hex.substring(index * 2, index * 2 + 2);
|
|
9
|
+
ret += parseInt(byte, 16).toString(2).padStart(8, "0");
|
|
10
|
+
}
|
|
11
|
+
return ret;
|
|
12
|
+
}
|
|
13
|
+
exports.hexToBinary = hexToBinary;
|
|
14
|
+
// bitwise compare
|
|
15
|
+
function m(operand1, operand2) {
|
|
16
|
+
let operand1Bits = hexToBinary(operand1);
|
|
17
|
+
const operand2Bits = hexToBinary(operand2);
|
|
18
|
+
if (operand1Bits.length < operand2Bits.length) {
|
|
19
|
+
operand1Bits = operand1Bits.padEnd(operand2Bits.length, "0");
|
|
20
|
+
}
|
|
21
|
+
let oneFound = false;
|
|
22
|
+
let zeroFound = false;
|
|
23
|
+
for (let index = 0; index < operand2Bits.length; index++) {
|
|
24
|
+
const o1bit = operand1Bits.substring(index, index + 1);
|
|
25
|
+
const o2bit = operand2Bits.substring(index, index + 1);
|
|
26
|
+
if (o2bit === "1") {
|
|
27
|
+
if (o1bit === "1") {
|
|
28
|
+
oneFound = true;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
zeroFound = true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return oneFound && zeroFound;
|
|
36
|
+
}
|
|
37
|
+
exports.m = m;
|
|
38
|
+
//# sourceMappingURL=m.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.o = void 0;
|
|
4
|
+
const m_1 = require("./m");
|
|
5
|
+
// bitwise compare
|
|
6
|
+
function o(operand1, operand2) {
|
|
7
|
+
let operand1Bits = (0, m_1.hexToBinary)(operand1);
|
|
8
|
+
const operand2Bits = (0, m_1.hexToBinary)(operand2);
|
|
9
|
+
if (operand1Bits.length < operand2Bits.length) {
|
|
10
|
+
operand1Bits = operand1Bits.padEnd(operand2Bits.length, "0");
|
|
11
|
+
}
|
|
12
|
+
// let oneFound = false;
|
|
13
|
+
let zeroFound = false;
|
|
14
|
+
for (let index = 0; index < operand2Bits.length; index++) {
|
|
15
|
+
const o1bit = operand1Bits.substring(index, index + 1);
|
|
16
|
+
const o2bit = operand2Bits.substring(index, index + 1);
|
|
17
|
+
if (o2bit === "1") {
|
|
18
|
+
if (o1bit === "1") {
|
|
19
|
+
// oneFound = true;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
zeroFound = true;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return zeroFound === false;
|
|
27
|
+
}
|
|
28
|
+
exports.o = o;
|
|
29
|
+
//# sourceMappingURL=o.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.z = void 0;
|
|
4
|
+
const m_1 = require("./m");
|
|
5
|
+
// bitwise compare
|
|
6
|
+
function z(operand1, operand2) {
|
|
7
|
+
let operand1Bits = (0, m_1.hexToBinary)(operand1);
|
|
8
|
+
const operand2Bits = (0, m_1.hexToBinary)(operand2);
|
|
9
|
+
if (operand1Bits.length < operand2Bits.length) {
|
|
10
|
+
operand1Bits = operand1Bits.padEnd(operand2Bits.length, "0");
|
|
11
|
+
}
|
|
12
|
+
let oneFound = false;
|
|
13
|
+
// let zeroFound = false;
|
|
14
|
+
for (let index = 0; index < operand2Bits.length; index++) {
|
|
15
|
+
const o1bit = operand1Bits.substring(index, index + 1);
|
|
16
|
+
const o2bit = operand2Bits.substring(index, index + 1);
|
|
17
|
+
if (o2bit === "1") {
|
|
18
|
+
if (o1bit === "1") {
|
|
19
|
+
oneFound = true;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
// zeroFound = true;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return oneFound === false;
|
|
27
|
+
}
|
|
28
|
+
exports.z = z;
|
|
29
|
+
//# sourceMappingURL=z.js.map
|