if message:
self.error(message)
else:
- self.error("Expected '%s'" % what)
+ if self.sy == IDENT:
+ found = self.systring
+ else:
+ found = self.sy
+ self.error("Expected '%s', found '%s'" % (what, found))
def expect_indent(self):
self.expect('INDENT',
_ERRORS = u"""
2: 5: Expected an identifier, found 'pass'
3: 9: Empty declarator
- 4:11: Expected ':'
+ 4:11: Expected ':', found 'class'
"""
_ERRORS = u"""
2: 6: cdef blocks cannot be declared cpdef
3: 6: cdef blocks cannot be declared cpdef
- 3:12: Expected ':'
+ 3:12: Expected ':', found 'class'
"""
pass
_ERRORS = u"""
-1:12: Expected 'struct'
+1:12: Expected 'struct', found 'foo'
"""