fix bug in search-list.sml: when we find a match, we should start 1 idx after the end position of the match

This commit is contained in:
2025-10-06 11:58:03 +01:00
parent cca2602429
commit ea01f1689c

View File

@@ -136,17 +136,12 @@ struct
let
val searchList =
PersistentVector.append (startPos, prevFinalPos, searchList)
(* we start 1 idx after the final position we found *)
val newStart = prevFinalPos + 1
in
rangeLoop
( dfa
, bufferPos + 1
, buffer
, finishIdx
, searchList
, 0
, bufferPos + 1
, ~1
)
(dfa, newStart, buffer, finishIdx, searchList, 0, newStart, ~1)
end
else
(* continue searching for match *)