mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
more whitspace fixes
This commit is contained in:
parent
9afa5d9fc5
commit
2e52ce54b9
2 changed files with 9 additions and 2 deletions
|
@ -48,7 +48,7 @@ def assert_tokens_equal(x, y):
|
|||
if len(diffs) > 0:
|
||||
msg = ['The token sequnces differ: ']
|
||||
for a, b in diffs:
|
||||
msg += ['', '- ' + repr(x), '+ ' + repr(y)]
|
||||
msg += ['', '- ' + repr(a), '+ ' + repr(b)]
|
||||
msg = '\n'.join(msg)
|
||||
raise AssertionError(msg)
|
||||
|
||||
|
@ -80,6 +80,13 @@ def test_post_whitespace():
|
|||
exp = [('INT_LITERAL', '42', 1, 0)]
|
||||
yield check_tokens, input, exp
|
||||
|
||||
def test_internal_whitespace():
|
||||
input = '42 +\t65'
|
||||
exp = [('INT_LITERAL', '42', 1, 0),
|
||||
('PLUS', '+', 1, 4),
|
||||
('INT_LITERAL', '65', 1, 6),]
|
||||
yield check_tokens, input, exp
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -146,7 +146,7 @@ class Lexer(object):
|
|||
# Rules
|
||||
#
|
||||
t_INDENT = r'^[ \t]+'
|
||||
t_ignore_WHITESPACE = r' \t'
|
||||
t_ignore_WHITESPACE = r'[ \t]+'
|
||||
|
||||
# Newlines
|
||||
def t_NEWLINE(self, t):
|
||||
|
|
Loading…
Add table
Reference in a new issue