@abaplint/runtime 2.5.37 → 2.5.39
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/abap_regex.d.ts +4 -4
- package/build/src/abap_regex.js +18 -18
- package/build/src/binary_search.d.ts +5 -5
- package/build/src/binary_search.js +48 -48
- package/build/src/builtin/abs.d.ts +5 -5
- package/build/src/builtin/abs.js +17 -17
- package/build/src/builtin/boolc.d.ts +4 -4
- package/build/src/builtin/boolc.js +22 -22
- package/build/src/builtin/ceil.d.ts +5 -5
- package/build/src/builtin/ceil.js +17 -17
- package/build/src/builtin/concat_lines_of.d.ts +7 -7
- package/build/src/builtin/concat_lines_of.js +15 -15
- package/build/src/builtin/condense.d.ts +9 -9
- package/build/src/builtin/condense.js +28 -28
- package/build/src/builtin/contains.d.ts +12 -12
- package/build/src/builtin/contains.js +15 -15
- package/build/src/builtin/cos.d.ts +5 -5
- package/build/src/builtin/cos.js +22 -22
- package/build/src/builtin/count.d.ts +12 -12
- package/build/src/builtin/count.js +37 -37
- package/build/src/builtin/count_any_of.d.ts +8 -8
- package/build/src/builtin/count_any_of.js +17 -17
- package/build/src/builtin/escape.d.ts +7 -7
- package/build/src/builtin/escape.js +30 -30
- package/build/src/builtin/find.d.ts +13 -13
- package/build/src/builtin/find.js +57 -57
- package/build/src/builtin/floor.d.ts +5 -5
- package/build/src/builtin/floor.js +17 -17
- package/build/src/builtin/frac.d.ts +6 -6
- package/build/src/builtin/frac.js +40 -40
- package/build/src/builtin/index.d.ts +47 -47
- package/build/src/builtin/index.js +64 -64
- package/build/src/builtin/insert.d.ts +9 -9
- package/build/src/builtin/insert.js +15 -15
- package/build/src/builtin/ipow.d.ts +6 -6
- package/build/src/builtin/ipow.js +27 -27
- package/build/src/builtin/lines.d.ts +4 -4
- package/build/src/builtin/lines.js +8 -8
- package/build/src/builtin/match.d.ts +5 -5
- package/build/src/builtin/match.js +22 -22
- package/build/src/builtin/matches.d.ts +6 -6
- package/build/src/builtin/matches.js +29 -29
- package/build/src/builtin/nmax.d.ts +14 -14
- package/build/src/builtin/nmax.js +34 -34
- package/build/src/builtin/nmin.d.ts +14 -14
- package/build/src/builtin/nmin.js +34 -34
- package/build/src/builtin/numofchar.d.ts +5 -5
- package/build/src/builtin/numofchar.js +15 -15
- package/build/src/builtin/repeat.d.ts +6 -6
- package/build/src/builtin/repeat.js +9 -9
- package/build/src/builtin/replace.d.ts +13 -13
- package/build/src/builtin/replace.js +65 -65
- package/build/src/builtin/reverse.d.ts +5 -5
- package/build/src/builtin/reverse.js +16 -16
- package/build/src/builtin/round.d.ts +8 -8
- package/build/src/builtin/round.js +41 -41
- package/build/src/builtin/segment.d.ts +8 -8
- package/build/src/builtin/segment.js +32 -32
- package/build/src/builtin/shift_left.d.ts +9 -9
- package/build/src/builtin/shift_left.js +30 -30
- package/build/src/builtin/sign.d.ts +5 -5
- package/build/src/builtin/sign.js +17 -17
- package/build/src/builtin/sin.d.ts +5 -5
- package/build/src/builtin/sin.js +22 -22
- package/build/src/builtin/sqrt.d.ts +5 -5
- package/build/src/builtin/sqrt.js +22 -22
- package/build/src/builtin/strlen.d.ts +5 -5
- package/build/src/builtin/strlen.js +15 -15
- package/build/src/builtin/substring.d.ts +8 -8
- package/build/src/builtin/substring.js +28 -28
- package/build/src/builtin/substring_after.d.ts +6 -6
- package/build/src/builtin/substring_after.js +28 -28
- package/build/src/builtin/substring_before.d.ts +6 -6
- package/build/src/builtin/substring_before.js +28 -28
- package/build/src/builtin/sy.d.ts +2 -2
- package/build/src/builtin/sy.js +30 -30
- package/build/src/builtin/tan.d.ts +5 -5
- package/build/src/builtin/tan.js +22 -22
- package/build/src/builtin/to_lower.d.ts +4 -4
- package/build/src/builtin/to_lower.js +9 -9
- package/build/src/builtin/to_mixed.d.ts +9 -9
- package/build/src/builtin/to_mixed.js +48 -48
- package/build/src/builtin/to_upper.d.ts +4 -4
- package/build/src/builtin/to_upper.js +9 -9
- package/build/src/builtin/translate.d.ts +6 -6
- package/build/src/builtin/translate.js +19 -19
- package/build/src/builtin/trunc.d.ts +5 -5
- package/build/src/builtin/trunc.js +17 -17
- package/build/src/builtin/xstrlen.d.ts +5 -5
- package/build/src/builtin/xstrlen.js +13 -13
- package/build/src/classic_error.d.ts +6 -6
- package/build/src/classic_error.js +10 -10
- package/build/src/clone.d.ts +1 -1
- package/build/src/clone.js +37 -37
- package/build/src/compare/assigned.d.ts +2 -2
- package/build/src/compare/assigned.js +7 -7
- package/build/src/compare/between.d.ts +2 -2
- package/build/src/compare/between.js +9 -9
- package/build/src/compare/ca.d.ts +3 -3
- package/build/src/compare/ca.js +36 -36
- package/build/src/compare/cn.d.ts +3 -3
- package/build/src/compare/cn.js +8 -8
- package/build/src/compare/co.d.ts +4 -4
- package/build/src/compare/co.js +37 -37
- package/build/src/compare/cp.d.ts +4 -4
- package/build/src/compare/cp.js +48 -48
- package/build/src/compare/cs.d.ts +3 -3
- package/build/src/compare/cs.js +33 -33
- package/build/src/compare/eq.d.ts +4 -4
- package/build/src/compare/eq.js +134 -134
- package/build/src/compare/ge.d.ts +3 -3
- package/build/src/compare/ge.js +8 -8
- package/build/src/compare/gt.d.ts +4 -4
- package/build/src/compare/gt.js +107 -107
- package/build/src/compare/in.d.ts +4 -4
- package/build/src/compare/in.js +34 -34
- package/build/src/compare/index.d.ts +22 -22
- package/build/src/compare/index.js +40 -40
- package/build/src/compare/initial.d.ts +4 -4
- package/build/src/compare/initial.js +63 -63
- package/build/src/compare/instance_of.d.ts +2 -2
- package/build/src/compare/instance_of.js +7 -7
- package/build/src/compare/le.d.ts +3 -3
- package/build/src/compare/le.js +8 -8
- package/build/src/compare/lt.d.ts +4 -4
- package/build/src/compare/lt.js +8 -8
- package/build/src/compare/m.d.ts +3 -3
- package/build/src/compare/m.js +37 -37
- package/build/src/compare/na.d.ts +3 -3
- package/build/src/compare/na.js +8 -8
- package/build/src/compare/ne.d.ts +3 -3
- package/build/src/compare/ne.js +8 -8
- package/build/src/compare/np.d.ts +3 -3
- package/build/src/compare/np.js +8 -8
- package/build/src/compare/ns.d.ts +3 -3
- package/build/src/compare/ns.js +8 -8
- package/build/src/compare/o.d.ts +2 -2
- package/build/src/compare/o.js +28 -28
- package/build/src/compare/z.d.ts +2 -2
- package/build/src/compare/z.js +28 -28
- package/build/src/console.d.ts +7 -7
- package/build/src/console.js +21 -21
- package/build/src/context.d.ts +13 -13
- package/build/src/context.js +17 -17
- package/build/src/db/db.d.ts +55 -55
- package/build/src/db/db.js +2 -2
- package/build/src/expand_dynamic.d.ts +2 -2
- package/build/src/expand_dynamic.js +22 -22
- package/build/src/expand_in.d.ts +2 -2
- package/build/src/expand_in.js +24 -24
- package/build/src/index.d.ts +52 -52
- package/build/src/index.js +54 -54
- package/build/src/offset_length.d.ts +16 -16
- package/build/src/offset_length.js +78 -78
- package/build/src/operators/_bit_operations.d.ts +6 -6
- package/build/src/operators/_bit_operations.js +29 -29
- package/build/src/operators/_parse.d.ts +4 -4
- package/build/src/operators/_parse.js +45 -45
- package/build/src/operators/add.d.ts +4 -4
- package/build/src/operators/add.js +42 -42
- package/build/src/operators/bit-and.d.ts +2 -2
- package/build/src/operators/bit-and.js +18 -18
- package/build/src/operators/bit-not.d.ts +2 -2
- package/build/src/operators/bit-not.js +14 -14
- package/build/src/operators/bit-or.d.ts +2 -2
- package/build/src/operators/bit-or.js +18 -18
- package/build/src/operators/bit-xor.d.ts +2 -2
- package/build/src/operators/bit-xor.js +18 -18
- package/build/src/operators/concat.d.ts +4 -4
- package/build/src/operators/concat.js +35 -35
- package/build/src/operators/div.d.ts +4 -4
- package/build/src/operators/div.js +12 -12
- package/build/src/operators/divide.d.ts +4 -4
- package/build/src/operators/divide.js +16 -16
- package/build/src/operators/index.d.ts +12 -12
- package/build/src/operators/index.js +28 -28
- package/build/src/operators/minus.d.ts +4 -4
- package/build/src/operators/minus.js +41 -41
- package/build/src/operators/mod.d.ts +4 -4
- package/build/src/operators/mod.js +12 -12
- package/build/src/operators/multiply.d.ts +4 -4
- package/build/src/operators/multiply.js +29 -29
- package/build/src/operators/power.d.ts +4 -4
- package/build/src/operators/power.js +9 -9
- package/build/src/rfc.d.ts +25 -25
- package/build/src/rfc.js +2 -2
- package/build/src/statements/append.d.ts +13 -13
- package/build/src/statements/append.js +66 -66
- package/build/src/statements/assert.d.ts +1 -1
- package/build/src/statements/assert.js +9 -9
- package/build/src/statements/assign.d.ts +12 -12
- package/build/src/statements/assign.js +136 -136
- package/build/src/statements/call_function.d.ts +15 -15
- package/build/src/statements/call_function.js +35 -35
- package/build/src/statements/cast.d.ts +2 -2
- package/build/src/statements/cast.js +56 -56
- package/build/src/statements/clear.d.ts +4 -4
- package/build/src/statements/clear.js +7 -7
- package/build/src/statements/collect.d.ts +3 -3
- package/build/src/statements/collect.js +13 -13
- package/build/src/statements/commit.d.ts +1 -1
- package/build/src/statements/commit.js +7 -7
- package/build/src/statements/concatenate.d.ts +11 -11
- package/build/src/statements/concatenate.js +47 -47
- package/build/src/statements/condense.d.ts +4 -4
- package/build/src/statements/condense.js +15 -15
- package/build/src/statements/convert.d.ts +14 -14
- package/build/src/statements/convert.js +78 -78
- package/build/src/statements/create_data.d.ts +16 -16
- package/build/src/statements/create_data.js +154 -154
- package/build/src/statements/delete_database.d.ts +13 -13
- package/build/src/statements/delete_database.js +51 -51
- package/build/src/statements/delete_internal.d.ts +12 -12
- package/build/src/statements/delete_internal.js +106 -99
- package/build/src/statements/describe.d.ts +13 -13
- package/build/src/statements/describe.js +89 -89
- package/build/src/statements/find.d.ts +17 -17
- package/build/src/statements/find.js +173 -168
- package/build/src/statements/get_bit.d.ts +4 -4
- package/build/src/statements/get_bit.js +12 -12
- package/build/src/statements/get_locale.d.ts +2 -2
- package/build/src/statements/get_locale.js +8 -8
- package/build/src/statements/get_parameter.d.ts +2 -2
- package/build/src/statements/get_parameter.js +9 -9
- package/build/src/statements/get_run_time.d.ts +2 -2
- package/build/src/statements/get_run_time.js +16 -16
- package/build/src/statements/get_time.d.ts +9 -9
- package/build/src/statements/get_time.js +30 -30
- package/build/src/statements/index.d.ts +96 -96
- package/build/src/statements/index.js +115 -115
- package/build/src/statements/insert_database.d.ts +13 -13
- package/build/src/statements/insert_database.js +56 -56
- package/build/src/statements/insert_internal.d.ts +13 -13
- package/build/src/statements/insert_internal.js +113 -113
- package/build/src/statements/loop.d.ts +15 -15
- package/build/src/statements/loop.js +115 -115
- package/build/src/statements/message.d.ts +17 -17
- package/build/src/statements/message.js +89 -89
- package/build/src/statements/modify_database.d.ts +12 -12
- package/build/src/statements/modify_database.js +39 -39
- package/build/src/statements/modify_internal.d.ts +7 -7
- package/build/src/statements/modify_internal.js +29 -29
- package/build/src/statements/move_corresponding.d.ts +2 -2
- package/build/src/statements/move_corresponding.js +10 -10
- package/build/src/statements/overlay.d.ts +3 -3
- package/build/src/statements/overlay.js +16 -16
- package/build/src/statements/raise_event.d.ts +1 -1
- package/build/src/statements/raise_event.js +8 -8
- package/build/src/statements/read_report.d.ts +8 -8
- package/build/src/statements/read_report.js +14 -14
- package/build/src/statements/read_table.d.ts +22 -22
- package/build/src/statements/read_table.js +130 -130
- package/build/src/statements/replace.d.ts +13 -13
- package/build/src/statements/replace.js +60 -60
- package/build/src/statements/rollback.d.ts +1 -1
- package/build/src/statements/rollback.js +7 -7
- package/build/src/statements/select.d.ts +8 -8
- package/build/src/statements/select.js +77 -77
- package/build/src/statements/set_bit.d.ts +4 -4
- package/build/src/statements/set_bit.js +41 -41
- package/build/src/statements/set_handler.d.ts +3 -3
- package/build/src/statements/set_handler.js +8 -8
- package/build/src/statements/set_locale.d.ts +2 -2
- package/build/src/statements/set_locale.js +7 -7
- package/build/src/statements/shift.d.ts +12 -12
- package/build/src/statements/shift.js +113 -113
- package/build/src/statements/sort.d.ts +9 -9
- package/build/src/statements/sort.js +82 -82
- package/build/src/statements/split.d.ts +9 -9
- package/build/src/statements/split.js +38 -38
- package/build/src/statements/translate.d.ts +2 -2
- package/build/src/statements/translate.js +39 -39
- package/build/src/statements/update_database.d.ts +14 -14
- package/build/src/statements/update_database.js +53 -53
- package/build/src/statements/write.d.ts +17 -17
- package/build/src/statements/write.js +56 -56
- package/build/src/template_formatting.d.ts +14 -14
- package/build/src/template_formatting.js +82 -82
- package/build/src/throw_error.d.ts +1 -1
- package/build/src/throw_error.js +14 -14
- package/build/src/types/_abstract_type_data.d.ts +5 -5
- package/build/src/types/_abstract_type_data.js +2 -2
- package/build/src/types/_character.d.ts +11 -11
- package/build/src/types/_character.js +2 -2
- package/build/src/types/_date_helper.d.ts +2 -2
- package/build/src/types/_date_helper.js +40 -40
- package/build/src/types/_numeric.d.ts +5 -5
- package/build/src/types/_numeric.js +2 -2
- package/build/src/types/abap_object.d.ts +11 -11
- package/build/src/types/abap_object.js +32 -32
- package/build/src/types/character.d.ts +26 -26
- package/build/src/types/character.js +111 -111
- package/build/src/types/data_reference.d.ts +28 -28
- package/build/src/types/data_reference.js +88 -88
- package/build/src/types/date.d.ts +20 -20
- package/build/src/types/date.js +66 -66
- package/build/src/types/decfloat34.d.ts +11 -11
- package/build/src/types/decfloat34.js +45 -45
- package/build/src/types/field_symbol.d.ts +32 -32
- package/build/src/types/field_symbol.js +115 -115
- package/build/src/types/float.d.ts +15 -15
- package/build/src/types/float.js +74 -74
- package/build/src/types/hex.d.ts +20 -20
- package/build/src/types/hex.js +81 -81
- package/build/src/types/index.d.ts +17 -17
- package/build/src/types/index.js +33 -33
- package/build/src/types/integer.d.ts +15 -15
- package/build/src/types/integer.js +56 -56
- package/build/src/types/numc.d.ts +21 -21
- package/build/src/types/numc.js +48 -48
- package/build/src/types/packed.d.ts +19 -19
- package/build/src/types/packed.js +53 -53
- package/build/src/types/string.d.ts +19 -19
- package/build/src/types/string.js +86 -86
- package/build/src/types/structure.d.ts +23 -23
- package/build/src/types/structure.js +113 -113
- package/build/src/types/table.d.ts +55 -55
- package/build/src/types/table.js +220 -220
- package/build/src/types/time.d.ts +20 -20
- package/build/src/types/time.js +67 -67
- package/build/src/types/utc_long.d.ts +18 -18
- package/build/src/types/utc_long.js +26 -26
- package/build/src/types/xstring.d.ts +18 -18
- package/build/src/types/xstring.js +70 -70
- package/build/src/unit_test.d.ts +26 -26
- package/build/src/unit_test.js +75 -75
- package/package.json +2 -2
|
@@ -1,169 +1,174 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.find = void 0;
|
|
4
|
-
const abap_regex_1 = require("../abap_regex");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
function find(input, options) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
8
|
-
let sectionOffset = (_a = options.sectionOffset) === null || _a === void 0 ? void 0 : _a.get();
|
|
9
|
-
if (sectionOffset && options.byteMode) {
|
|
10
|
-
sectionOffset = sectionOffset * 2;
|
|
11
|
-
}
|
|
12
|
-
let s = "";
|
|
13
|
-
if (options.find) {
|
|
14
|
-
s = options.find;
|
|
15
|
-
if (typeof s !== "string") {
|
|
16
|
-
s = s.get();
|
|
17
|
-
}
|
|
18
|
-
if (s === "") {
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
abap.builtin.sy.get().subrc.set(0);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
s = s.replace(/\[/g, "\\[");
|
|
24
|
-
s = s.replace(/\]/g, "\\]");
|
|
25
|
-
s = s.replace(/\?/g, "\\?");
|
|
26
|
-
s = s.replace(/\(/g, "\\(");
|
|
27
|
-
s = s.replace(/\)/g, "\\)");
|
|
28
|
-
s = s.replace(/\./g, "\\.");
|
|
29
|
-
s = s.replace(/\|/g, "\\|");
|
|
30
|
-
s = s.replace(/\*/g, "\\*");
|
|
31
|
-
s = s.replace(/\+/g, "\\+");
|
|
32
|
-
s = new RegExp(s, "g");
|
|
33
|
-
}
|
|
34
|
-
else if (options.regex) {
|
|
35
|
-
if (options.regex === "") {
|
|
36
|
-
throw "FIND, runtime, no input, regex empty";
|
|
37
|
-
}
|
|
38
|
-
let r = options.regex;
|
|
39
|
-
if (typeof r !== "string") {
|
|
40
|
-
r = r.get();
|
|
41
|
-
}
|
|
42
|
-
if (typeof r === "string") {
|
|
43
|
-
r = abap_regex_1.ABAPRegExp.convert(r);
|
|
44
|
-
}
|
|
45
|
-
else if (r.constructor.name === "cl_abap_regex") {
|
|
46
|
-
const obj = r;
|
|
47
|
-
// @ts-ignore
|
|
48
|
-
r = obj.mv_pattern.get();
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
if (obj.mv_ignore_case.get() === "X") {
|
|
51
|
-
options.ignoringCase = true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
throw "find(), unexpected input";
|
|
56
|
-
}
|
|
57
|
-
s = new RegExp(r, "gm" + (options.ignoringCase === true ? "i" : ""));
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
throw "FIND, runtime, no input";
|
|
61
|
-
}
|
|
62
|
-
const matches = [];
|
|
63
|
-
if (input instanceof types_1.Table) {
|
|
64
|
-
let line = 1;
|
|
65
|
-
for (const blah of input.array()) {
|
|
66
|
-
let temp;
|
|
67
|
-
// eslint-disable-next-line no-cond-assign
|
|
68
|
-
while (temp = s.exec(blah.get())) {
|
|
69
|
-
matches.push(Object.assign(Object.assign({}, temp), { line }));
|
|
70
|
-
if (options.first === true) {
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
line++;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
let blah = input.get();
|
|
79
|
-
if (sectionOffset) {
|
|
80
|
-
blah = blah.substr(sectionOffset);
|
|
81
|
-
}
|
|
82
|
-
let temp;
|
|
83
|
-
// eslint-disable-next-line no-cond-assign
|
|
84
|
-
while (temp = s.exec(blah)) {
|
|
85
|
-
matches.push(temp);
|
|
86
|
-
if (options.first === true) {
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (options.submatches) {
|
|
92
|
-
for (let index = 0; index < options.submatches.length; index++) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
match.get().
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
submatch.get().
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.find = void 0;
|
|
4
|
+
const abap_regex_1 = require("../abap_regex");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
function find(input, options) {
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
8
|
+
let sectionOffset = (_a = options.sectionOffset) === null || _a === void 0 ? void 0 : _a.get();
|
|
9
|
+
if (sectionOffset && options.byteMode) {
|
|
10
|
+
sectionOffset = sectionOffset * 2;
|
|
11
|
+
}
|
|
12
|
+
let s = "";
|
|
13
|
+
if (options.find) {
|
|
14
|
+
s = options.find;
|
|
15
|
+
if (typeof s !== "string") {
|
|
16
|
+
s = s.get();
|
|
17
|
+
}
|
|
18
|
+
if (s === "") {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
s = s.replace(/\[/g, "\\[");
|
|
24
|
+
s = s.replace(/\]/g, "\\]");
|
|
25
|
+
s = s.replace(/\?/g, "\\?");
|
|
26
|
+
s = s.replace(/\(/g, "\\(");
|
|
27
|
+
s = s.replace(/\)/g, "\\)");
|
|
28
|
+
s = s.replace(/\./g, "\\.");
|
|
29
|
+
s = s.replace(/\|/g, "\\|");
|
|
30
|
+
s = s.replace(/\*/g, "\\*");
|
|
31
|
+
s = s.replace(/\+/g, "\\+");
|
|
32
|
+
s = new RegExp(s, "g");
|
|
33
|
+
}
|
|
34
|
+
else if (options.regex) {
|
|
35
|
+
if (options.regex === "") {
|
|
36
|
+
throw "FIND, runtime, no input, regex empty";
|
|
37
|
+
}
|
|
38
|
+
let r = options.regex;
|
|
39
|
+
if (typeof r !== "string") {
|
|
40
|
+
r = r.get();
|
|
41
|
+
}
|
|
42
|
+
if (typeof r === "string") {
|
|
43
|
+
r = abap_regex_1.ABAPRegExp.convert(r);
|
|
44
|
+
}
|
|
45
|
+
else if (r.constructor.name === "cl_abap_regex") {
|
|
46
|
+
const obj = r;
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
r = obj.mv_pattern.get();
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
if (obj.mv_ignore_case.get() === "X") {
|
|
51
|
+
options.ignoringCase = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
throw "find(), unexpected input";
|
|
56
|
+
}
|
|
57
|
+
s = new RegExp(r, "gm" + (options.ignoringCase === true ? "i" : ""));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
throw "FIND, runtime, no input";
|
|
61
|
+
}
|
|
62
|
+
const matches = [];
|
|
63
|
+
if (input instanceof types_1.Table) {
|
|
64
|
+
let line = 1;
|
|
65
|
+
for (const blah of input.array()) {
|
|
66
|
+
let temp;
|
|
67
|
+
// eslint-disable-next-line no-cond-assign
|
|
68
|
+
while (temp = s.exec(blah.get())) {
|
|
69
|
+
matches.push(Object.assign(Object.assign({}, temp), { line }));
|
|
70
|
+
if (options.first === true) {
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
line++;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
let blah = input.get();
|
|
79
|
+
if (sectionOffset) {
|
|
80
|
+
blah = blah.substr(sectionOffset);
|
|
81
|
+
}
|
|
82
|
+
let temp;
|
|
83
|
+
// eslint-disable-next-line no-cond-assign
|
|
84
|
+
while (temp = s.exec(blah)) {
|
|
85
|
+
matches.push(temp);
|
|
86
|
+
if (options.first === true) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (options.submatches) {
|
|
92
|
+
for (let index = 0; index < options.submatches.length; index++) {
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
if (matches[0] && matches[0][index + 1]) {
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
options.submatches[index].set(matches[0][index + 1]);
|
|
97
|
+
}
|
|
98
|
+
else if (matches.length > 0) {
|
|
99
|
+
options.submatches[index].clear();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (options.results) {
|
|
104
|
+
// assumption, results is a table with the correct type
|
|
105
|
+
options.results.clear();
|
|
106
|
+
for (const m of matches) {
|
|
107
|
+
const match = new types_1.Structure({
|
|
108
|
+
line: new types_1.Integer(),
|
|
109
|
+
offset: new types_1.Integer(),
|
|
110
|
+
length: new types_1.Integer(),
|
|
111
|
+
submatches: new types_1.Table(new types_1.Structure({ offset: new types_1.Integer(), length: new types_1.Integer() })),
|
|
112
|
+
});
|
|
113
|
+
match.get().line.set(m.line || 0);
|
|
114
|
+
match.get().offset.set(m.index);
|
|
115
|
+
match.get().length.set(m[0].length);
|
|
116
|
+
const submatch = new types_1.Structure({ offset: new types_1.Integer(), length: new types_1.Integer() });
|
|
117
|
+
for (let i = 1; i < m.length; i++) {
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
if (m[i] === undefined) {
|
|
120
|
+
submatch.get().offset.set(-1);
|
|
121
|
+
submatch.get().length.set(0);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
// @ts-ignore
|
|
125
|
+
submatch.get().offset.set(m.index + m[0].indexOf(m[i]));
|
|
126
|
+
// @ts-ignore
|
|
127
|
+
submatch.get().length.set(m[i].length);
|
|
128
|
+
}
|
|
129
|
+
match.get().submatches.append(submatch);
|
|
130
|
+
}
|
|
131
|
+
if (options.results instanceof types_1.Table) {
|
|
132
|
+
options.results.append(match);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
options.results.set(match);
|
|
136
|
+
}
|
|
137
|
+
if (options.first === undefined || options.first === true) {
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (matches.length === 0) {
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
abap.builtin.sy.get().subrc.set(4);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
// @ts-ignore
|
|
148
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
149
|
+
}
|
|
150
|
+
if (((_b = matches[0]) === null || _b === void 0 ? void 0 : _b.index) !== undefined) {
|
|
151
|
+
let val = matches[0].index;
|
|
152
|
+
if (sectionOffset) {
|
|
153
|
+
val += sectionOffset;
|
|
154
|
+
}
|
|
155
|
+
if (options.byteMode) {
|
|
156
|
+
val = val / 2;
|
|
157
|
+
}
|
|
158
|
+
(_c = options.offset) === null || _c === void 0 ? void 0 : _c.set(val);
|
|
159
|
+
}
|
|
160
|
+
if (options === null || options === void 0 ? void 0 : options.count) {
|
|
161
|
+
(_d = options.count) === null || _d === void 0 ? void 0 : _d.set(matches.length);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
(_e = options.count) === null || _e === void 0 ? void 0 : _e.clear();
|
|
165
|
+
}
|
|
166
|
+
if ((options === null || options === void 0 ? void 0 : options.length) && matches && matches[0]) {
|
|
167
|
+
(_f = options.length) === null || _f === void 0 ? void 0 : _f.set(matches[0][0].length);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
(_g = options.length) === null || _g === void 0 ? void 0 : _g.clear();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.find = find;
|
|
169
174
|
//# sourceMappingURL=find.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Hex, XString } from "../types";
|
|
2
|
-
import { ICharacter } from "../types/_character";
|
|
3
|
-
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function getBit(number: INumeric, hex: XString | Hex, output: ICharacter): void;
|
|
1
|
+
import { Hex, XString } from "../types";
|
|
2
|
+
import { ICharacter } from "../types/_character";
|
|
3
|
+
import { INumeric } from "../types/_numeric";
|
|
4
|
+
export declare function getBit(number: INumeric, hex: XString | Hex, output: ICharacter): void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBit = void 0;
|
|
4
|
-
function getBit(number, hex, output) {
|
|
5
|
-
const charIndex = Math.floor((number.get() - 1) / 8);
|
|
6
|
-
const bitIndex = (number.get() - 1) % 8;
|
|
7
|
-
const h = hex.get().substr(charIndex * 2, 2);
|
|
8
|
-
const parsed = parseInt(h, 16).toString(2);
|
|
9
|
-
const bits = parsed.padStart(8, "0");
|
|
10
|
-
output.set(bits.substr(bitIndex, 1));
|
|
11
|
-
}
|
|
12
|
-
exports.getBit = getBit;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBit = void 0;
|
|
4
|
+
function getBit(number, hex, output) {
|
|
5
|
+
const charIndex = Math.floor((number.get() - 1) / 8);
|
|
6
|
+
const bitIndex = (number.get() - 1) % 8;
|
|
7
|
+
const h = hex.get().substr(charIndex * 2, 2);
|
|
8
|
+
const parsed = parseInt(h, 16).toString(2);
|
|
9
|
+
const bits = parsed.padStart(8, "0");
|
|
10
|
+
output.set(bits.substr(bitIndex, 1));
|
|
11
|
+
}
|
|
12
|
+
exports.getBit = getBit;
|
|
13
13
|
//# sourceMappingURL=get_bit.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICharacter } from "../types/_character";
|
|
2
|
-
export declare function getLocale(target: ICharacter): void;
|
|
1
|
+
import { ICharacter } from "../types/_character";
|
|
2
|
+
export declare function getLocale(target: ICharacter): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLocale = void 0;
|
|
4
|
-
function getLocale(target) {
|
|
5
|
-
// todo
|
|
6
|
-
target.set("E");
|
|
7
|
-
}
|
|
8
|
-
exports.getLocale = getLocale;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLocale = void 0;
|
|
4
|
+
function getLocale(target) {
|
|
5
|
+
// todo
|
|
6
|
+
target.set("E");
|
|
7
|
+
}
|
|
8
|
+
exports.getLocale = getLocale;
|
|
9
9
|
//# sourceMappingURL=get_locale.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICharacter } from "../types/_character";
|
|
2
|
-
export declare function getParameter(_source: ICharacter, _target: ICharacter): void;
|
|
1
|
+
import { ICharacter } from "../types/_character";
|
|
2
|
+
export declare function getParameter(_source: ICharacter, _target: ICharacter): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getParameter = void 0;
|
|
4
|
-
function getParameter(_source, _target) {
|
|
5
|
-
// todo, additional logic? call ABAP kernel class?
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
abap.builtin.sy.get().subrc.set(4);
|
|
8
|
-
}
|
|
9
|
-
exports.getParameter = getParameter;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getParameter = void 0;
|
|
4
|
+
function getParameter(_source, _target) {
|
|
5
|
+
// todo, additional logic? call ABAP kernel class?
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
abap.builtin.sy.get().subrc.set(4);
|
|
8
|
+
}
|
|
9
|
+
exports.getParameter = getParameter;
|
|
10
10
|
//# sourceMappingURL=get_parameter.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { INumeric } from "../types/_numeric";
|
|
2
|
-
export declare function getRunTime(value: INumeric): void;
|
|
1
|
+
import { INumeric } from "../types/_numeric";
|
|
2
|
+
export declare function getRunTime(value: INumeric): void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRunTime = void 0;
|
|
4
|
-
let prev = undefined;
|
|
5
|
-
function getRunTime(value) {
|
|
6
|
-
if (prev === undefined) {
|
|
7
|
-
value.set(0);
|
|
8
|
-
prev = new Date().getTime();
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
const now = new Date().getTime();
|
|
12
|
-
value.set(now - prev);
|
|
13
|
-
prev = now;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.getRunTime = getRunTime;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRunTime = void 0;
|
|
4
|
+
let prev = undefined;
|
|
5
|
+
function getRunTime(value) {
|
|
6
|
+
if (prev === undefined) {
|
|
7
|
+
value.set(0);
|
|
8
|
+
prev = new Date().getTime();
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
const now = new Date().getTime();
|
|
12
|
+
value.set(now - prev);
|
|
13
|
+
prev = now;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.getRunTime = getRunTime;
|
|
17
17
|
//# sourceMappingURL=get_run_time.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Structure } from "../types";
|
|
2
|
-
import { ICharacter } from "../types/_character";
|
|
3
|
-
|
|
4
|
-
field?: ICharacter;
|
|
5
|
-
stamp?: ICharacter;
|
|
6
|
-
sy?: Structure;
|
|
7
|
-
};
|
|
8
|
-
export declare function getTime(options?: options): void;
|
|
9
|
-
export {};
|
|
1
|
+
import { Structure } from "../types";
|
|
2
|
+
import { ICharacter } from "../types/_character";
|
|
3
|
+
type options = {
|
|
4
|
+
field?: ICharacter;
|
|
5
|
+
stamp?: ICharacter;
|
|
6
|
+
sy?: Structure;
|
|
7
|
+
};
|
|
8
|
+
export declare function getTime(options?: options): void;
|
|
9
|
+
export {};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTime = void 0;
|
|
4
|
-
function getTime(options) {
|
|
5
|
-
const d = new Date();
|
|
6
|
-
const date = d.getUTCFullYear() +
|
|
7
|
-
(d.getUTCMonth() + 1 + "").padStart(2, "0") +
|
|
8
|
-
(d.getUTCDate() + "").padStart(2, "0");
|
|
9
|
-
const time = (d.getUTCHours() + "").padStart(2, "0") +
|
|
10
|
-
(d.getUTCMinutes() + "").padStart(2, "0") +
|
|
11
|
-
(d.getUTCSeconds() + "").padStart(2, "0");
|
|
12
|
-
if (options === undefined) {
|
|
13
|
-
options = {};
|
|
14
|
-
}
|
|
15
|
-
if ((options === null || options === void 0 ? void 0 : options.sy) === undefined) {
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
options.sy = abap.builtin.sy;
|
|
18
|
-
}
|
|
19
|
-
options.sy.get().datlo.set(date);
|
|
20
|
-
options.sy.get().datum.set(date);
|
|
21
|
-
options.sy.get().timlo.set(time);
|
|
22
|
-
options.sy.get().uzeit.set(time);
|
|
23
|
-
if (options === null || options === void 0 ? void 0 : options.field) {
|
|
24
|
-
options.field.set(time);
|
|
25
|
-
}
|
|
26
|
-
if (options === null || options === void 0 ? void 0 : options.stamp) {
|
|
27
|
-
options.stamp.set(date + time);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.getTime = getTime;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTime = void 0;
|
|
4
|
+
function getTime(options) {
|
|
5
|
+
const d = new Date();
|
|
6
|
+
const date = d.getUTCFullYear() +
|
|
7
|
+
(d.getUTCMonth() + 1 + "").padStart(2, "0") +
|
|
8
|
+
(d.getUTCDate() + "").padStart(2, "0");
|
|
9
|
+
const time = (d.getUTCHours() + "").padStart(2, "0") +
|
|
10
|
+
(d.getUTCMinutes() + "").padStart(2, "0") +
|
|
11
|
+
(d.getUTCSeconds() + "").padStart(2, "0");
|
|
12
|
+
if (options === undefined) {
|
|
13
|
+
options = {};
|
|
14
|
+
}
|
|
15
|
+
if ((options === null || options === void 0 ? void 0 : options.sy) === undefined) {
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
options.sy = abap.builtin.sy;
|
|
18
|
+
}
|
|
19
|
+
options.sy.get().datlo.set(date);
|
|
20
|
+
options.sy.get().datum.set(date);
|
|
21
|
+
options.sy.get().timlo.set(time);
|
|
22
|
+
options.sy.get().uzeit.set(time);
|
|
23
|
+
if (options === null || options === void 0 ? void 0 : options.field) {
|
|
24
|
+
options.field.set(time);
|
|
25
|
+
}
|
|
26
|
+
if (options === null || options === void 0 ? void 0 : options.stamp) {
|
|
27
|
+
options.stamp.set(date + time);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.getTime = getTime;
|
|
31
31
|
//# sourceMappingURL=get_time.js.map
|