summaryrefslogtreecommitdiff
path: root/scripts/find_error.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/find_error.py')
-rwxr-xr-xscripts/find_error.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/find_error.py b/scripts/find_error.py
index 199e9c5c..1b793790 100755
--- a/scripts/find_error.py
+++ b/scripts/find_error.py
@@ -123,7 +123,7 @@ def main(fn, lexer=None, options={}):
for tok, state in map(None, tokens, states):
show_token(tok, state)
else:
- for i in range(len(tokens) - num, len(tokens)):
+ for i in range(max(len(tokens) - num, 0), len(tokens)):
show_token(tokens[i], states[i])
print 'Error token:'
l = len(repr(val))