-
Notifications
You must be signed in to change notification settings - Fork 105
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
Control flow in {? } blocks #246
Comments
Allow `return` and `?` in the code block (#246), and prevent statements like `break`/`continue` from messing up enclosing loops.
Allow `return` and `?` in the code block (#246), and prevent statements like `break`/`continue` from messing up enclosing loops.
In #248, I tested making the expansion wrap all user-provided code in an immediately-invoked closure ( I'm also slightly concerned about the closure causing type inference issues. Definitely worth further investigation, though. |
Can the definition of RuleResult simply be changed to If for some reason (backwards compatibility?) this isn't possible, |
The issue is that the code block ends up somewhere in the middle of a big function that parses a whole rule of the grammar. If you were to If the code block is wrapped in a closure, |
Allow `return` and `?` in the code block (#246), and prevent statements like `break`/`continue` from messing up enclosing loops.
Reopening of #133.
IMO, this is a bug and not a user error. I'd expect to be able to use the full power of control flow, but I can't.
Workaround: wrap the code in a closure:
The text was updated successfully, but these errors were encountered: