Skip to content

Commit

Permalink
fix: accurate end_colno when the token contains newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Jun 16, 2021
1 parent 3c6000a commit 3cdb432
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tokenstream/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def emit_token(self, token_type: str, value: str = "") -> Token:
if (line_start := value.rfind("\n")) == -1:
end_colno = self.location.colno + len(value)
else:
end_colno = end_pos - line_start + 1
end_colno = len(value) - line_start

token = Token(
type=token_type,
Expand Down

0 comments on commit 3cdb432

Please sign in to comment.