Replies: 2 comments
-
Looks like a bug. Opened #313. I'm not sure there's an easy fix though, because there are two closures involved in the implementation of |
Beta Was this translation helpful? Give feedback.
0 replies
-
As a workaround, if you avoid the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I created a working parser for a non-trivial language syntax in a few hours, so that was pretty neat, thanks.
I needed to pass a &mut symbol table struct down the tree of parsing rules. This worked fine for all but precedence climbing and left recursive rules. The left recursion gave me an error message that arguments weren't supported.. fair enough. Precedence climbing just wouldn't compile. It gave an error about not being able to capture a mutable in the rule closure and needing a FnMut instead of a Fn. Left recursion was easy to solve, but creating separate nested rules for a dozen levels of precedence by hand was not so nice. My parser works, but is not as simple it would be with the precedence! macro.
Did I do something wrong? Is there a way to pass an argument down into the @ (next lower precedence rule) somehow?
Here's the code.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions