fix implementation of ZERO_OR_MORE (Kleene star) in dfa-gen.sml
This commit is contained in:
@@ -337,9 +337,20 @@ struct
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
getFollowsForPositionAndChar (r, pos, curChr)
|
getFollowsForPositionAndChar (r, pos, curChr)
|
||||||
| ZERO_OR_ONE child =>
|
|
||||||
getFollowsForPositionAndCharLoop (pos, regex, child, curChr)
|
|
||||||
| ZERO_OR_MORE child =>
|
| ZERO_OR_MORE child =>
|
||||||
|
let
|
||||||
|
val result = getFollowsForPositionAndChar (child, pos, curChr)
|
||||||
|
val {sawConcat, follows, charIsMatch} = result
|
||||||
|
in
|
||||||
|
if charIsMatch then
|
||||||
|
{ sawConcat = false
|
||||||
|
, follows = firstpos (child, follows)
|
||||||
|
, charIsMatch = true
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result
|
||||||
|
end
|
||||||
|
| ZERO_OR_ONE child =>
|
||||||
getFollowsForPositionAndCharLoop (pos, regex, child, curChr)
|
getFollowsForPositionAndCharLoop (pos, regex, child, curChr)
|
||||||
| ONE_OR_MORE child =>
|
| ONE_OR_MORE child =>
|
||||||
getFollowsForPositionAndCharLoop (pos, regex, child, curChr)
|
getFollowsForPositionAndCharLoop (pos, regex, child, curChr)
|
||||||
|
|||||||
Reference in New Issue
Block a user