~ chicken-core (chicken-5) e341d6dbc1cb52df4c2a5ed107b8755cbbef44d5
commit e341d6dbc1cb52df4c2a5ed107b8755cbbef44d5
Author: Peter Bex <peter@more-magic.net>
AuthorDate: Mon Jun 28 10:26:07 2021 +0200
Commit: Peter Bex <peter@more-magic.net>
CommitDate: Mon Jun 28 10:26:07 2021 +0200
Update irregex docs to clarify behaviour with empty matches in fold (ported from upstream 7260235)
diff --git a/manual/Module (chicken irregex) b/manual/Module (chicken irregex)
index 2be9fd92..e1e77a47 100644
--- a/manual/Module (chicken irregex)
+++ b/manual/Module (chicken irregex)
@@ -276,7 +276,14 @@ The rationale for providing the {{<from-index>}} (which is not
provided in the SCSH {{regexp-fold}} utility), is because this
information is useful (e.g. for extracting the unmatched portion of
the string before the current match, as needed in
-{{irregex-replace}}), and not otherwise directly accessible.
+{{irregex-replace/all}}), and not otherwise directly accessible.
+
+Note when the pattern matches an empty string, to avoid an infinite
+loop we continue from one char after the end of the match (as opposed
+to the end in the normal case). The {{<from-index>}} passed to
+the subsequent \scheme{<kons>} or {{<finish>}} still refers to
+the original previous match end, however, so {{irregex-split}}
+and {{irregex-replace/all}}, etc. do the right thing.
The optional {{<finish>}} takes two arguments:
Trap