Left Recursion or Left Associative Recursion #813
Unanswered
decipher3114
asked this question in
Q&A
Replies: 1 comment 2 replies
-
If you were looking at As for #131, there is no need for separators. If you look at the examples in #804, you'll see a full C expression parser which includes indexing. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Winnow misses the support for recursion. The problem of left recursion causes the stack to overflow.
For instance take the case of
$x[0][1][3]
,$x
is reference followed by indexing values.Instead of
Ref (x); Vec ( [0], [1], [3] )
, it should beCurrent implementation restricts this behaviour because it involves Left Recursion.
Expr::parse
internally calls the parse function for all the types.If
Expr::parse
is used as the first parser insideIndex::parse
, it recurses indefinitely (for invalid cases).I check #131 but I'm not sure if that is going to help here. there is no separator whatsoever.
I also thought about using the
separated_foldl
but the same thing.Any guidance on how to handle this would be helpful.
Beta Was this translation helpful? Give feedback.
All reactions