Skip to content

Commit

Permalink
Update lineno at the end of lines and block comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Smith authored and moses-palmer committed Oct 2, 2015
1 parent 6aa92d6 commit 8f9a39c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/slimit/lexer.py
Expand Up @@ -120,6 +120,7 @@ def token(self):
except IndexError:
tok = self._get_update_token()
if tok is not None and tok.type == 'LINE_TERMINATOR':
lexer.lineno += len(tok.value.splitlines());
continue
else:
return tok
Expand All @@ -128,6 +129,7 @@ def token(self):
tok = self._get_update_token()
if tok.type in ('LINE_TERMINATOR',
'LINE_COMMENT', 'BLOCK_COMMENT'):
lexer.lineno += len(tok.value.splitlines());
continue
else:
return tok
Expand Down

0 comments on commit 8f9a39c

Please sign in to comment.