Open jonhue opened 5 years ago
So as of now, the parser parses:
if true
1
else
1
true
but not:
if true
1
true
=> rply.errors.ParsingError: (None, SourcePosition(idx=13, lineno=4, colno=1))
or
if true
1
else if true
1
else
1
true
=> rply.errors.ParsingError: (None, SourcePosition(idx=29, lineno=5, colno=1))
Have you managed to figure this out? I'm facing a similar problem
Thanks! My problem wasn't really a shift/reduce problem, but this rep https://github.com/joshsharp/python-braid helped me. I'm just making a simple SQL-like language but was having a similar issue when defining SELECT
I tried quite a few things and still did not find a way to do this.
It seems to me as if the parser desperately tries to follow one path and when it fails, instead of looking for another, it just stops.
Here is my current implementation of a parser:
Here is the grammar:
Is there something wrong with my rules? How would you implement such a (common) grammar?