Open xldenis opened 5 months ago
Thanks a lot. I actually already had the same idea, but postponed implementing it, because it was not strictly necessary.
There are some design decisions to be made about the syntax, the generated node name, and the allowed types of parameters (tokens, rules, parameterized rules). Maybe something like this doesn't look too bad:
arguments: list{expression, ','};
parameters: list{parameter, ','};
list{element, Delimiter}: [element (Delimiter element)*];
I'll look into it once I find some time.
This seems like an awesome project, I'm looking forward to trying this out on some small projects, but I noticed a missing feature which makes parsers much nicer to use with generators: paramerized rules.
This was introduced (I think) by menhir for ocaml, and allows you to factor out common repetition patterns like those found to make lists, arguments etc...
with this we could have something like: