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 let
val searchList = val searchList =
PersistentVector.append (startPos, prevFinalPos, searchList) PersistentVector.append (startPos, prevFinalPos, searchList)
(* we start 1 idx after the final position we found *)
val newStart = prevFinalPos + 1
in in
rangeLoop rangeLoop
( dfa (dfa, newStart, buffer, finishIdx, searchList, 0, newStart, ~1)
, bufferPos + 1
, buffer
, finishIdx
, searchList
, 0
, bufferPos + 1
, ~1
)
end end
else else
(* continue searching for match *) (* continue searching for match *)