|
|
@@ -13,6 +13,8 @@ class UnexpectedInput(LexError): |
|
|
|
def __init__(self, seq, lex_pos, line, column, allowed=None): |
|
|
|
context = seq[lex_pos:lex_pos+5] |
|
|
|
message = "No token defined for: '%s' in %r at line %d col %d" % (seq[lex_pos], context, line, column) |
|
|
|
if allowed: |
|
|
|
message += '\n\nExpecting: %s\n' % allowed |
|
|
|
|
|
|
|
super(UnexpectedInput, self).__init__(message) |
|
|
|
|
|
|
|