diff options
author | Georg Brandl <georg@python.org> | 2012-02-06 07:30:30 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-02-06 07:30:30 +0100 |
commit | bb2f7a8bdfce72f688d1c673c087213b73f47447 (patch) | |
tree | 316bc100ad349c4a07ac2b1fe373e9ecf25937ea /scripts/find_error.py | |
parent | 0af9aeea0bff0b5af3a8801140e641ac38b01ced (diff) | |
parent | a2d3afbf60be0693638a05f0485c445f4d5413da (diff) | |
download | pygments-bb2f7a8bdfce72f688d1c673c087213b73f47447.tar.gz |
Merge newLISP lexer from https://bitbucket.org/cormullion/pygments-main
Diffstat (limited to 'scripts/find_error.py')
-rwxr-xr-x | scripts/find_error.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/find_error.py b/scripts/find_error.py index 199e9c5c..453f16ed 100755 --- a/scripts/find_error.py +++ b/scripts/find_error.py @@ -8,7 +8,7 @@ the text where Error tokens are being generated, along with some context. - :copyright: Copyright 2006-2011 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -101,6 +101,9 @@ def main(fn, lexer=None, options={}): if lx.__class__.__bases__ == (RegexLexer,): lx.__class__.__bases__ = (DebuggingRegexLexer,) debug_lexer = True + elif lx.__class__.__bases__ == (DebuggingRegexLexer,): + # already debugged before + debug_lexer = True lno = 1 text = file(fn, 'U').read() text = text.strip('\n') + '\n' @@ -123,7 +126,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)) |