BioJulia / Automa.jl

A julia code generator for regular expressions
Other
188 stars 15 forks source link

Better error on compiling null regex #108

Closed jakobnissen closed 2 years ago

jakobnissen commented 2 years ago

It is possible for users to construct a regex that matches the null set, i.e. no strings, not even the empty string. An example is re"A" & re"B". Automa could support these, but don't currently, as there is no point to. However, attempting to compile such a regex currently throws an obscure internal error.

This PR improves that error.

See issue #104

codecov[bot] commented 2 years ago

Codecov Report

Merging #108 (3bd7b08) into master (69d16f5) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #108   +/-   ##
=======================================
  Coverage   90.76%   90.76%           
=======================================
  Files          16       16           
  Lines        1808     1809    +1     
=======================================
+ Hits         1641     1642    +1     
  Misses        167      167           
Flag Coverage Δ
unittests 90.76% <100.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/nfa.jl 99.30% <100.00%> (+<0.01%) :arrow_up:
src/codegen.jl 91.58% <0.00%> (-0.03%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.