diff options
author | Georg Brandl <georg@python.org> | 2021-05-30 07:12:04 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2021-05-30 07:12:58 +0200 |
commit | 0d5397ad05cb652d2e743911d3e9cb2b23159658 (patch) | |
tree | d34ed36ecfc61071006b59e50a3956db5d12b8e3 /scripts | |
parent | e8803c5e756bf2f78d913d546348bfd2987c918d (diff) | |
download | pygments-git-0d5397ad05cb652d2e743911d3e9cb2b23159658.tar.gz |
TNT: fix reliance on "assert" stmt, handle recursion
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/debug_lexer.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/debug_lexer.py b/scripts/debug_lexer.py index a76265f5..5cc0ef6f 100755 --- a/scripts/debug_lexer.py +++ b/scripts/debug_lexer.py @@ -191,7 +191,8 @@ def main(fn, lexer=None, options={}): reprs = list(map(repr, tok)) print(' ' + reprs[1] + ' ' + ' ' * (29-len(reprs[1])) + reprs[0], end=' ') if debug_lexer: - print(' ' + ' ' * (29-len(reprs[0])) + ' : '.join(state) if state else '', end=' ') + print(' ' + ' ' * (29-len(reprs[0])) + ' : '.join(state) + if state else '', end=' ') print() for type, val in lx.get_tokens(text): @@ -206,10 +207,10 @@ def main(fn, lexer=None, options={}): else: show_token(tokens[i], None) print('Error token:') - l = len(repr(val)) + vlen = len(repr(val)) print(' ' + repr(val), end=' ') if debug_lexer and hasattr(lx, 'ctx'): - print(' ' * (60-l) + ' : '.join(lx.ctx.stack), end=' ') + print(' ' * (60-vlen) + ' : '.join(lx.ctx.stack), end=' ') print() print() return 1 |