Skip to content

Commit

Permalink
Enable ambiguity check
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen committed Jul 21, 2022
1 parent 2295db1 commit 6036343
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dfa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/machine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 6036343

Please sign in to comment.