-
Notifications
You must be signed in to change notification settings - Fork 56
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
Error thrown for some rules with single elemets #32
Comments
@nasser Sorry it took me so long to respond to you. There's a reason this doesn't work but it's also prompted me to add support for the thing you're trying to do. Actions are for constructing new nodes, i.e. instead of Canopy constructing its own parse tree nodes, it delegates to your action to do that. Therefore they only apply to rules that make new nodes which are:
They don't apply to the So for example in However I think there is possibly an ergonomic benefit in making Does that make sense? I've just pushed ca4041d which implements this functionality and I'd value your feedback. |
I just ran into this too. The ca4041d commit solves some of the problems, but my brief attempts to fix the others didn't work as I expected. I have a rule of the form:
I was able to get it to parse last night by a similar approach to ca4041d, but not to generate a call to action2. |
I managed to figure out an approach to solve this that will be fixed by #49 |
I'm going to close this because I believe the central problem identified in this issue (making |
These work:
But this fails with a grammar parsing error
The text was updated successfully, but these errors were encountered: