fix type errors
This commit is contained in:
@@ -301,7 +301,7 @@ struct
|
|||||||
fun getFollowsForPositionAndChar (regex: regex, pos, curChr) =
|
fun getFollowsForPositionAndChar (regex: regex, pos, curChr) =
|
||||||
case regex of
|
case regex of
|
||||||
CHAR_LITERAL {char, position = _} =>
|
CHAR_LITERAL {char, position = _} =>
|
||||||
if char = curChr then
|
if Char.ord char = curChr then
|
||||||
{sawConcat = false, follows = [], charIsMatch = true}
|
{sawConcat = false, follows = [], charIsMatch = true}
|
||||||
else
|
else
|
||||||
{sawConcat = false, follows = [], charIsMatch = false}
|
{sawConcat = false, follows = [], charIsMatch = false}
|
||||||
@@ -363,7 +363,7 @@ struct
|
|||||||
val followSet =
|
val followSet =
|
||||||
List.foldl
|
List.foldl
|
||||||
(fn (fp, followSet) => Set.insertOrReplace (fp, (), followSet))
|
(fn (fp, followSet) => Set.insertOrReplace (fp, (), followSet))
|
||||||
fpList
|
followSet (#follows fpList)
|
||||||
in
|
in
|
||||||
getFollowPositionsFromList (tl, regex, char, followSet)
|
getFollowPositionsFromList (tl, regex, char, followSet)
|
||||||
end
|
end
|
||||||
@@ -371,10 +371,12 @@ struct
|
|||||||
|
|
||||||
fun appendIfNew (pos, dstates, newStates) =
|
fun appendIfNew (pos, dstates, newStates) =
|
||||||
if pos = Vector.length dstates then
|
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
|
else
|
||||||
let
|
let
|
||||||
val {transitions, marked = _} = Vector.sub (dstates, pos)
|
val {transitions: int list, marked = _} = Vector.sub (dstates, pos)
|
||||||
in
|
in
|
||||||
if transitions = newStates then dstates
|
if transitions = newStates then dstates
|
||||||
else appendIfNew (pos + 1, dstates, newStates)
|
else appendIfNew (pos + 1, dstates, newStates)
|
||||||
@@ -451,17 +453,7 @@ struct
|
|||||||
val follows = raise Fail "todo"
|
val follows = raise Fail "todo"
|
||||||
|
|
||||||
(* add any new transitions we find *)
|
(* add any new transitions we find *)
|
||||||
val newdstates = Set.foldl
|
val newdstates = raise Fail "todo"
|
||||||
( fn (subtree, dstates) =>
|
|
||||||
let
|
|
||||||
val subtreeStates = Set.keysToList subtree
|
|
||||||
val dstates = appendIfNew (0, dstates, subtreeStates)
|
|
||||||
in
|
|
||||||
dstates
|
|
||||||
end
|
|
||||||
, follows
|
|
||||||
, dstates
|
|
||||||
)
|
|
||||||
in
|
in
|
||||||
convertLoop (regex, newdstates)
|
convertLoop (regex, newdstates)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user