diff --git a/src/dfa.jl b/src/dfa.jl index 90650508..929266eb 100644 --- a/src/dfa.jl +++ b/src/dfa.jl @@ -37,7 +37,7 @@ function validate(dfa::DFA) end end -function nfa2dfa(nfa::NFA, unambiguous::Bool=false) +function nfa2dfa(nfa::NFA, unambiguous::Bool=true) newnodes = Dict{Set{NFANode},DFANode}() new(S) = get!(newnodes, S, DFANode(nfa.final ∈ S, S)) isvisited(S) = haskey(newnodes, S) diff --git a/src/machine.jl b/src/machine.jl index 805266f2..b36b6bd8 100644 --- a/src/machine.jl +++ b/src/machine.jl @@ -51,7 +51,7 @@ machine let end ``` """ -function compile(re::RegExp.RE; optimize::Bool=true, unambiguous::Bool=false) +function compile(re::RegExp.RE; optimize::Bool=true, unambiguous::Bool=true) dfa = nfa2dfa(remove_dead_nodes(re2nfa(re)), unambiguous) if optimize dfa = remove_dead_nodes(reduce_nodes(dfa))