@abaplint/runtime 2.13.9 → 2.13.11
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/statements/find.js +11 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.find = find;
|
|
4
4
|
const abap_regex_1 = require("../abap_regex");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
|
+
const throw_error_1 = require("../throw_error");
|
|
6
7
|
function find(input, options) {
|
|
7
8
|
let sectionOffset = options.sectionOffset?.get();
|
|
8
9
|
if (sectionOffset && options.byteMode) {
|
|
@@ -48,6 +49,9 @@ function find(input, options) {
|
|
|
48
49
|
// eslint-disable-next-line no-cond-assign
|
|
49
50
|
while (temp = s.exec(blah.get())) {
|
|
50
51
|
matches.push({ ...temp, line });
|
|
52
|
+
if (temp.index === s.lastIndex) {
|
|
53
|
+
s.lastIndex++;
|
|
54
|
+
}
|
|
51
55
|
if (options.first === true) {
|
|
52
56
|
break;
|
|
53
57
|
}
|
|
@@ -58,12 +62,18 @@ function find(input, options) {
|
|
|
58
62
|
else {
|
|
59
63
|
let blah = input.get();
|
|
60
64
|
if (sectionOffset) {
|
|
65
|
+
if (sectionOffset > blah.length) {
|
|
66
|
+
(0, throw_error_1.throwError)("CX_SY_RANGE_OUT_OF_BOUNDS");
|
|
67
|
+
}
|
|
61
68
|
blah = blah.substr(sectionOffset);
|
|
62
69
|
}
|
|
63
70
|
let temp;
|
|
64
71
|
// eslint-disable-next-line no-cond-assign
|
|
65
72
|
while (temp = s.exec(blah)) {
|
|
66
73
|
matches.push(temp);
|
|
74
|
+
if (temp.index === s.lastIndex) {
|
|
75
|
+
s.lastIndex++;
|
|
76
|
+
}
|
|
67
77
|
if (options.first === true) {
|
|
68
78
|
break;
|
|
69
79
|
}
|
|
@@ -146,7 +156,7 @@ function find(input, options) {
|
|
|
146
156
|
options.length?.set(matches[0][0].length);
|
|
147
157
|
}
|
|
148
158
|
else {
|
|
149
|
-
options.length?.clear();
|
|
159
|
+
// options.length?.clear();
|
|
150
160
|
}
|
|
151
161
|
}
|
|
152
162
|
//# sourceMappingURL=find.js.map
|