classes and functions are new statements and should never get removed by the error recovery.

This commit is contained in:
Dave Halter
2014-11-28 02:44:34 +01:00
parent 128dbd34b6
commit 31600b9552
3 changed files with 9 additions and 2 deletions
+3 -2
View File
@@ -166,8 +166,9 @@ class Parser(object):
# Done parsing, but another token is input
raise ParseError("too much input", type, value, start_pos)
else:
self.error_recovery(self.grammar, self.stack, type, value, start_pos)
break
if self.error_recovery(self.grammar, self.stack, type,
value, start_pos):
break
def classify(self, type, value, start_pos):
"""Turn a token into a label. (Internal)"""