Skip to content

Commit

Permalink
ignore indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKim0407 committed Dec 28, 2019
1 parent e5defb3 commit 8335a57
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions clausewitz/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def filter_tokens(tokens: _typing.Iterable[_TokenInfo]) -> _typing.Iterator[_Tok
_tokenize.NEWLINE,
_tokenize.NL,
_tokenize.COMMENT,
_tokenize.INDENT,
_tokenize.DEDENT,
_tokenize.ENDMARKER,
):
continue
Expand Down
2 changes: 1 addition & 1 deletion tests/data/sample.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ worl\"d\""
f = {}
d < 100
# this is a comment
color = rgb { 100 200 50 }
color = rgb { 100 200 50 }
4 changes: 3 additions & 1 deletion tests/util/test_tokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_prepare(data):
f = {}
d < 100
# this is a comment
color = rgb { 100 200 50 }
color = rgb { 100 200 50 }
'''

with data('sample.txt') as readline:
Expand Down Expand Up @@ -76,6 +76,7 @@ def test_tokenize(data):
(tokenize.COMMENT, '# this is a comment'),
(tokenize.NL, '\n'),

(tokenize.INDENT, ' '),
(tokenize.NAME, 'color'),
(tokenize.OP, '='),
(tokenize.NAME, 'rgb'),
Expand All @@ -85,6 +86,7 @@ def test_tokenize(data):
(tokenize.NUMBER, '50'),
(tokenize.OP, '}'),
(tokenize.NEWLINE, '\n'),
(tokenize.DEDENT, ''),

(tokenize.ENDMARKER, ''),
)
Expand Down

0 comments on commit 8335a57

Please sign in to comment.