summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/debug_lexer.py7
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