Explicitly set missing source on LexExceptions
This fixes the following code: (import [hy.lex [tokenize]]) (tokenize "(foo))")
This commit is contained in:
parent
d95bfbaa8e
commit
0ba620fc73
@ -35,3 +35,7 @@ def tokenize(buf):
|
||||
pos = e.getsourcepos()
|
||||
raise LexException("Could not identify the next token.",
|
||||
pos.lineno, pos.colno)
|
||||
except LexException as e:
|
||||
if e.source is None:
|
||||
e.source = buf
|
||||
raise
|
||||
|
Loading…
x
Reference in New Issue
Block a user