def error_recovery(self, token): if self._error_recovery: raise NotImplementedError("Error Recovery is not implemented") else: type_, value, start_pos, prefix = token error_leaf = tree.ErrorLeaf(type_, value, start_pos, prefix) raise ParserSyntaxError('SyntaxError: invalid syntax', error_leaf)
def error_recovery(self, pgen_grammar, stack, arcs, typ, value, start_pos, prefix, add_token_callback): if self._error_recovery: raise NotImplementedError("Error Recovery is not implemented") else: error_leaf = tree.ErrorLeaf('TODO %s' % typ, value, start_pos, prefix) raise ParserSyntaxError('SyntaxError: invalid syntax', error_leaf)