You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The behavior you observe is correct, given the above grammar. The rule term succeeds parsing prod, but then fails to match the following + so it retries with the second part parsing prod. The same happens for the rule prod. The parens trigger this unfortunate behavior.
I need to build a math expression parser, so I started playing around a bit with the example. I found some strange behavior though.
When I run this code:
I get this as output:
I think that means
1 + 2
went through twice, while it only has to be computed once. Perhaps there is a bug somewhere?The text was updated successfully, but these errors were encountered: