BioJulia / Automa.jl

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

Looping regex can be given a final action #115

Closed jakobnissen closed 1 year ago

jakobnissen commented 1 year ago

MWE:

julia> Automa.execute(compile(onfinal!(re"a+", :x)), "aaa")
(0, [:x, :x, :x])

On master syntax:

julia> Automa.execute(Automa.compile((x = Automa.RegExp.parse("a+"); x.actions[:final] = [:x]; x)), "aaa")
(0, [:x, :x, :x])

The problem here is that in the regex re"a+", it's not clear what the final byte is. This should be fixed in re2nfa