From 303bcdf23d75d43af141f677f83d87c87e0a199a Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Sun, 5 Oct 2025 20:27:48 +0100 Subject: [PATCH] fix type errors --- fcore/search-list/dfa-gen.sml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/fcore/search-list/dfa-gen.sml b/fcore/search-list/dfa-gen.sml index 5cd98f3..1d5bd26 100644 --- a/fcore/search-list/dfa-gen.sml +++ b/fcore/search-list/dfa-gen.sml @@ -301,7 +301,7 @@ struct fun getFollowsForPositionAndChar (regex: regex, pos, curChr) = case regex of CHAR_LITERAL {char, position = _} => - if char = curChr then + if Char.ord char = curChr then {sawConcat = false, follows = [], charIsMatch = true} else {sawConcat = false, follows = [], charIsMatch = false} @@ -363,7 +363,7 @@ struct val followSet = List.foldl (fn (fp, followSet) => Set.insertOrReplace (fp, (), followSet)) - fpList + followSet (#follows fpList) in getFollowPositionsFromList (tl, regex, char, followSet) end @@ -371,10 +371,12 @@ struct fun appendIfNew (pos, dstates, newStates) = if pos = Vector.length dstates then - Vector.concat [dstates, Vector.fromList [newStates]] + let val record = {transitions = newStates, marked = false} + in Vector.concat [dstates, Vector.fromList [record]] + end else let - val {transitions, marked = _} = Vector.sub (dstates, pos) + val {transitions: int list, marked = _} = Vector.sub (dstates, pos) in if transitions = newStates then dstates else appendIfNew (pos + 1, dstates, newStates) @@ -451,17 +453,7 @@ struct val follows = raise Fail "todo" (* add any new transitions we find *) - val newdstates = Set.foldl - ( fn (subtree, dstates) => - let - val subtreeStates = Set.keysToList subtree - val dstates = appendIfNew (0, dstates, subtreeStates) - in - dstates - end - , follows - , dstates - ) + val newdstates = raise Fail "todo" in convertLoop (regex, newdstates) end