8000 gh-120343: Fix column offsets of multiline tokens in tokenize by lysnikolaou · Pull Request #120391 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120343: Fix column offsets of multiline tokens in tokenize #120391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix tests
  • Loading branch information
lysnikolaou committed Jun 12, 2024
commit 6f86ce875d165c21239519cb03b9f5c14cc60c34
1 change: 1 addition & 0 deletions Python/Python-tokenize.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ tokenizeriter_next(tokenizeriterobject *it)
byte_offset = token.start - line_start;
if (line_changed) {
col_offset = _PyPegen_byte_offset_to_character_offset_line(line, 0, byte_offset);
it->byte_col_offset_diff = byte_offset - col_offset;
}
else {
col_offset = byte_offset - it->byte_col_offset_diff;
Expand Down
Loading
0