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
There's a very easy mistake to make here, if you have a single entry in the table and you miss the end comma, e.g.
precedence = (
('left', 'ARROW')
)
Python flattens the tuple, so the precedence would simply be ('left', 'ARROW') instead of (('left', 'ARROW'),).
The way to fix this is to simply add a , to the end of the entry, but its not clear what the issue is once you make a mistake.
This flattening trips the following line:
When creating a precedence table, the example in the documentation suggests to do something like this:
There's a very easy mistake to make here, if you have a single entry in the table and you miss the end comma, e.g.
Python flattens the tuple, so the
precedence
would simply be('left', 'ARROW')
instead of(('left', 'ARROW'),)
.The way to fix this is to simply add a
,
to the end of the entry, but its not clear what the issue is once you make a mistake.This flattening trips the following line:
ply/src/ply/yacc.py
Line 2161 in 66369a6
My suggestion is to make this line a bit more descriptive, including what it expected, what it got, and a note about tuple flattening:
ply/src/ply/yacc.py
Line 2162 in 66369a6
I intend on making a pull request with a solution later.
The text was updated successfully, but these errors were encountered: