gll icon indicating copy to clipboard operation
gll copied to clipboard

Parametric ("macro"?) grammar rules.

Open eddyb opened this issue 7 years ago • 0 comments

Allow defining rules that expand based on parameters - we can start off with something like this:

eq(x, x) = {};
Expr(allow_ident_left, allow_ident_right) = {
    eq(allow_ident_left, "1") eq(allow_ident_right, "1") Ident |
    Expr(allow_ident_left, "1") "+" Expr("1", allow_ident_right) |
    ...
}

Incidentally, that example is close to one of the possible solutions for #14.

eddyb avatar Aug 25 '18 05:08 eddyb