@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.
@@ -11,6 +11,9 @@ export * from "./gt";
11
11
  export * from "./initial";
12
12
  export * from "./le";
13
13
  export * from "./lt";
14
+ export * from "./o";
15
+ export * from "./z";
16
+ export * from "./m";
14
17
  export * from "./ne";
15
18
  export * from "./na";
16
19
  export * from "./ns";
@@ -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,3 @@
1
+ import { Hex, XString } from "../types";
2
+ export declare function hexToBinary(input: Hex | XString): string;
3
+ export declare function m(operand1: Hex | XString, operand2: Hex | XString): boolean;
@@ -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,2 @@
1
+ import { Hex, XString } from "../types";
2
+ export declare function o(operand1: Hex | XString, operand2: Hex | XString): boolean;
@@ -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,2 @@
1
+ import { Hex, XString } from "../types";
2
+ export declare function z(operand1: Hex | XString, operand2: Hex | XString): boolean;
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.1.86",
3
+ "version": "2.1.88",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",