Open zeenix opened 1 month ago
I would like something like:
delimited( opt(char('(')), many1(my_parser), opt(char(')'), )
so that outer () are optional but I would only want them optional together so unmatched () are treated as an error.
()
A maybe_delimited function that treats the delimiters as optional in combination, would help with this.
maybe_delimited
I cant provide this if needed but of course it would not work currently. :)
Could be easily written as alt(body | delimited(left, body, right)), right?
alt(body | delimited(left, body, right))
I would like something like:
so that outer
()
are optional but I would only want them optional together so unmatched()
are treated as an error.A
maybe_delimited
function that treats the delimiters as optional in combination, would help with this.Test case
I cant provide this if needed but of course it would not work currently. :)