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:
@@ -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 *)
|
||||||
|
|||||||
Reference in New Issue
Block a user