@abaplint/runtime 2.10.6 → 2.10.7
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FieldSymbol, HashedTable, Table } from "../types";
|
|
2
2
|
import { INumeric } from "../types/_numeric";
|
|
3
3
|
export interface IDeleteInternalOptions {
|
|
4
|
-
where?: (i: any) => boolean
|
|
4
|
+
where?: (i: any) => Promise<boolean>;
|
|
5
5
|
index?: INumeric;
|
|
6
6
|
adjacent?: boolean;
|
|
7
7
|
comparing?: string[];
|
|
@@ -79,7 +79,7 @@ async function deleteInternal(target, options) {
|
|
|
79
79
|
index = abap.builtin.sy.get().tabix.get() - 1;
|
|
80
80
|
if (options?.where) {
|
|
81
81
|
const row = i instanceof types_1.Structure ? i.get() : { table_line: i };
|
|
82
|
-
if (options.where(row) === true) {
|
|
82
|
+
if (await options.where(row) === true) {
|
|
83
83
|
if (target instanceof types_1.HashedTable) {
|
|
84
84
|
target.deleteFrom(i);
|
|
85
85
|
}
|
|
@@ -38,7 +38,8 @@ function replace(input) {
|
|
|
38
38
|
found = temp.match(search) !== null;
|
|
39
39
|
}
|
|
40
40
|
else if (input.pcre) {
|
|
41
|
-
const
|
|
41
|
+
const str = input.pcre.get();
|
|
42
|
+
const regex = abap_regex_1.ABAPRegExp.convert(str);
|
|
42
43
|
if (regex.length === 0 && input.all === true) {
|
|
43
44
|
throw "REPLACE, zero length input";
|
|
44
45
|
}
|
|
@@ -82,6 +83,10 @@ function replace(input) {
|
|
|
82
83
|
}
|
|
83
84
|
input.replacementLength.set(replacement.length);
|
|
84
85
|
}
|
|
86
|
+
if (input.replacementCount) {
|
|
87
|
+
const match = temp.match(search);
|
|
88
|
+
input.replacementCount.set(match?.length || 0);
|
|
89
|
+
}
|
|
85
90
|
temp = temp.replace(search, rr);
|
|
86
91
|
const subrc = found ? 0 : 4;
|
|
87
92
|
// @ts-ignore
|