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
According to the documentation, production rules can signal errors by raising the SyntaxError exception. However when I try this, my program crashes due to an IndexError exception inside Ply.
Generating LALR tables
Traceback (most recent call last):
File "PlyTest3.py", line 26, in <module>
print(parser.parse('a b'))
File "<...>\ply\yacc.py", line 331, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "<...>\ply\yacc.py", line 1115, in parseopt_notrack
state = statestack[-1]
IndexError: list index out of range
Should I be doing something differently when raising an error?
The text was updated successfully, but these errors were encountered:
According to the documentation, production rules can signal errors by raising the
SyntaxError
exception. However when I try this, my program crashes due to an IndexError exception inside Ply.A simple example:
The result of running this code is:
Should I be doing something differently when raising an error?
The text was updated successfully, but these errors were encountered: