When usinge for example RegExp.rep I get re.rep("a") to parse "aYa" through Automa.execute:
using Automa
import Automa.RegExp: @re_str
const re = Automa.RegExp
a = re"a"
a.actions[:exit] = [:a]
withrep = Automa.compile(re.rep(a))
Automa.execute(withrep, "aYa") # return (0, [:a, :a])
Actually generating the machine code and executing correctly fails to parse "aYa". I believe the following should do the exact same thing as Automa.execute:
context = Automa.CodeGenContext()
@eval function test_func(data)
$(Automa.generate_init_code(context, test))
p_end = p_eof = lastindex(data)
as = []
emit() = push!(as, :a)
$(Automa.generate_exec_code(context, test, Dict(:a => :(emit()))))
return cs, as
end
test_func("aYa") # (-2, Any[])
test_func("aa") # (0, Any["a", "a"])
When usinge for example
RegExp.rep
I getre.rep("a")
to parse"aYa"
throughAutoma.execute
:Actually generating the machine code and executing correctly fails to parse
"aYa"
. I believe the following should do the exact same thing asAutoma.execute
:I'm using Automa 0.8.2.