fix implementation of 'lastpos', which should return the lastpos of the right child in a CONCAT node, if the right child is not nullable, or else should return the union of lastpos for the left and right child both
This commit is contained in:
@@ -187,7 +187,7 @@ struct
|
|||||||
in lastpos (r2, acc)
|
in lastpos (r2, acc)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
lastpos (r1, acc)
|
lastpos (r2, acc)
|
||||||
| ALTERNATION (r1, r2) =>
|
| ALTERNATION (r1, r2) =>
|
||||||
let val acc = lastpos (r1, acc)
|
let val acc = lastpos (r1, acc)
|
||||||
in lastpos (r2, acc)
|
in lastpos (r2, acc)
|
||||||
@@ -203,4 +203,7 @@ struct
|
|||||||
case ParseNfa.parse (str, 0) of
|
case ParseNfa.parse (str, 0) of
|
||||||
SOME (ast, _) => SOME ast
|
SOME (ast, _) => SOME ast
|
||||||
| NONE => NONE
|
| NONE => NONE
|
||||||
|
|
||||||
|
fun firstpos regex = ToDfa.firstpos (regex, [])
|
||||||
|
fun lastpos regex = ToDfa.lastpos (regex, [])
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user