@abaplint/runtime 2.7.144 → 2.7.146
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.
|
@@ -30,7 +30,20 @@ class OffsetLength {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
get() {
|
|
33
|
-
|
|
33
|
+
if (this.isHex) {
|
|
34
|
+
let offset = this.offset;
|
|
35
|
+
if (offset) {
|
|
36
|
+
offset = offset / 2;
|
|
37
|
+
}
|
|
38
|
+
let length = this.length;
|
|
39
|
+
if (length) {
|
|
40
|
+
length = length / 2;
|
|
41
|
+
}
|
|
42
|
+
return this.obj.getOffset({ offset: offset, length: length }).get();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return this.obj.getOffset({ offset: this.offset, length: this.length }).get();
|
|
46
|
+
}
|
|
34
47
|
}
|
|
35
48
|
set(value) {
|
|
36
49
|
let val = "";
|
|
@@ -18,6 +18,7 @@ import { readReport } from "./read_report";
|
|
|
18
18
|
import { raiseEvent } from "./raise_event";
|
|
19
19
|
import { receive } from "./receive";
|
|
20
20
|
import { getLocale } from "./get_locale";
|
|
21
|
+
import { unpack } from "./unpack";
|
|
21
22
|
import { getParameter } from "./get_parameter";
|
|
22
23
|
import { setLocale } from "./set_locale";
|
|
23
24
|
import { getRunTime } from "./get_run_time";
|
|
@@ -65,6 +66,7 @@ export declare class Statements {
|
|
|
65
66
|
deleteInternal: typeof deleteInternal;
|
|
66
67
|
describe: typeof describe;
|
|
67
68
|
find: typeof find;
|
|
69
|
+
unpack: typeof unpack;
|
|
68
70
|
getBit: typeof getBit;
|
|
69
71
|
readReport: typeof readReport;
|
|
70
72
|
getLocale: typeof getLocale;
|
|
@@ -21,6 +21,7 @@ const read_report_1 = require("./read_report");
|
|
|
21
21
|
const raise_event_1 = require("./raise_event");
|
|
22
22
|
const receive_1 = require("./receive");
|
|
23
23
|
const get_locale_1 = require("./get_locale");
|
|
24
|
+
const unpack_1 = require("./unpack");
|
|
24
25
|
const get_parameter_1 = require("./get_parameter");
|
|
25
26
|
const set_locale_1 = require("./set_locale");
|
|
26
27
|
const get_run_time_1 = require("./get_run_time");
|
|
@@ -70,6 +71,7 @@ class Statements {
|
|
|
70
71
|
this.deleteInternal = delete_internal_1.deleteInternal;
|
|
71
72
|
this.describe = describe_1.describe;
|
|
72
73
|
this.find = find_1.find;
|
|
74
|
+
this.unpack = unpack_1.unpack;
|
|
73
75
|
this.getBit = get_bit_1.getBit;
|
|
74
76
|
this.readReport = read_report_1.readReport;
|
|
75
77
|
this.getLocale = get_locale_1.getLocale;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unpack = void 0;
|
|
4
|
+
const throw_error_1 = require("../throw_error");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
async function unpack(source, target) {
|
|
7
|
+
if (source instanceof types_1.FieldSymbol) {
|
|
8
|
+
const pointer = source.getPointer();
|
|
9
|
+
if (pointer === undefined) {
|
|
10
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
11
|
+
}
|
|
12
|
+
return unpack(pointer, target);
|
|
13
|
+
}
|
|
14
|
+
if (target instanceof types_1.FieldSymbol) {
|
|
15
|
+
const pointer = target.getPointer();
|
|
16
|
+
if (pointer === undefined) {
|
|
17
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
18
|
+
}
|
|
19
|
+
return unpack(source, pointer);
|
|
20
|
+
}
|
|
21
|
+
if (source instanceof types_1.Character && target instanceof types_1.Character) {
|
|
22
|
+
const sourceValue = source.getTrimEnd();
|
|
23
|
+
if (/^\d+$/.test(sourceValue) === false) {
|
|
24
|
+
(0, throw_error_1.throwError)("CX_SY_CONVERSION_NO_NUMBER");
|
|
25
|
+
}
|
|
26
|
+
target.set(sourceValue.padStart(target.getLength(), "0"));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
throw new Error("unpack, transpiler runtime todo, types");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.unpack = unpack;
|
|
33
|
+
//# sourceMappingURL=unpack.js.map
|