@abaplint/runtime 2.3.108 → 2.3.109
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.
|
@@ -6,7 +6,13 @@ const types_1 = require("../types");
|
|
|
6
6
|
function find(input) {
|
|
7
7
|
var _a, _b, _c, _d, _e;
|
|
8
8
|
let val = typeof input.val === "string" ? input.val : input.val.get();
|
|
9
|
+
if (input.len !== undefined) {
|
|
10
|
+
throw "transpiler find(), todo len";
|
|
11
|
+
}
|
|
9
12
|
if (input.regex) {
|
|
13
|
+
if (input.off !== undefined) {
|
|
14
|
+
throw "transpiler find(), todo off regex";
|
|
15
|
+
}
|
|
10
16
|
const caseInput = typeof input.case === "string" ? input.case : (_a = input.case) === null || _a === void 0 ? void 0 : _a.get();
|
|
11
17
|
const regex = typeof input.regex === "string" ? input.regex : input.regex.get();
|
|
12
18
|
const flags = caseInput !== "X" ? "i" : "";
|
|
@@ -38,11 +44,11 @@ function find(input) {
|
|
|
38
44
|
let found = -1;
|
|
39
45
|
for (let i = 0; i < occ; i++) {
|
|
40
46
|
found = val.indexOf(sub || "", off);
|
|
41
|
-
if (found
|
|
42
|
-
off =
|
|
47
|
+
if (found >= 0) {
|
|
48
|
+
off = found + 1;
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
|
-
if (negative === true && found
|
|
51
|
+
if (negative === true && found >= 0) {
|
|
46
52
|
found = val.length - found - 1;
|
|
47
53
|
}
|
|
48
54
|
return new types_1.Integer().set(found);
|