-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assign children name #101
Comments
It looks like you want sub rules, you can write this:
This produces the same AST as the fully expanded form, except that the nodes for the sub rules are anonymous, i.e.:
If you want names on the sub rules, then in the current state you indeed have to fully expand the grammar. IMO the expanded version is clearer than a more compact version, but YMMV. |
I forgot that you can also use virtual symbols and promote them if that's what you want :
will give you this:
|
If something like this is desirable:
It would be best to leverage the existing syntax for sub rules, expanded to look like this:
The output AST would be the same:
|
This would be awesome as I could leverage these information for AST building |
Wouldn't it be nice if we could do:
Instead of:
The text was updated successfully, but these errors were encountered: