Open ylixir opened 5 years ago
we need some way to do recursive parsers, and mutually recursive parsers.
the best i've come up with is labelling a parser with label and then referencing it with use
label
use
$parser = p::label("foo",p::block(p::lit("foo"),p::lit("bar"),p::use("foo");
this parser would parse "foofoobarbar" but "foofoobar" would give an error.
"foofoobarbar"
"foofoobar"
i think we can do this without labels, by making parser generator factory functions.
this is still something we may want to revisit down the road, but mainly for performance reasons
we need some way to do recursive parsers, and mutually recursive parsers.
the best i've come up with is labelling a parser with
label
and then referencing it withuse
this parser would parse
"foofoobarbar"
but"foofoobar"
would give an error.