Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Parametric ("macro"?) grammar rules. #27

Open
eddyb opened this issue Aug 25, 2018 · 0 comments
Open

Parametric ("macro"?) grammar rules. #27

eddyb opened this issue Aug 25, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@eddyb
Copy link
Member

eddyb commented Aug 25, 2018

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant