From 088c5c3d9876f95c74635ae5d047258deb59d68b Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Wed, 8 Oct 2025 10:39:49 +0100 Subject: [PATCH] checkpoint while implementing prevMatch functionality --- fcore/persistent-vector.sml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fcore/persistent-vector.sml b/fcore/persistent-vector.sml index e762951..41c8da2 100644 --- a/fcore/persistent-vector.sml +++ b/fcore/persistent-vector.sml @@ -193,12 +193,7 @@ struct val idx = BinSearch.equalOrMore (cursorIdx, sizes) in if idx < 0 then {start = ~1, finish = ~1} - else if idx = 0 then - let - val current = Vector.sub (values, 0) - in - current - end + else if idx = 0 then Vector.sub (values, 0) else let val current = Vector.sub (values, idx) @@ -215,7 +210,13 @@ struct val idx = BinSearch.equalOrMore (cursorIdx, sizes) in if idx < 0 then {start = ~1, finish = ~1} - else helpPrevMatch (cursorIdx, Vector.sub (nodes, idx)) + else + let + val node = Vector.sub (nodes, idx) + val result = helpPrevMatch (cursorIdx, node) + in + result + end end fun loopPrevMatch (prevStart, tree, count) =