mirror of
https://github.com/python/cpython.git
synced 2025-08-23 02:04:56 +00:00
[3.12] gh-112943: Correctly compute end offsets for multiline tokens in the tokenize module (GH-112949) (#112957)
(cherry picked from commit a135a6d2c6
)
This commit is contained in:
parent
f3933d4b98
commit
e4d2fb242a
5 changed files with 25 additions and 6 deletions
|
@ -224,7 +224,7 @@ tokenizeriter_next(tokenizeriterobject *it)
|
|||
col_offset = _PyPegen_byte_offset_to_character_offset(line, token.start - line_start);
|
||||
}
|
||||
if (token.end != NULL && token.end >= it->tok->line_start) {
|
||||
end_col_offset = _PyPegen_byte_offset_to_character_offset(line, token.end - it->tok->line_start);
|
||||
end_col_offset = _PyPegen_byte_offset_to_character_offset_raw(it->tok->line_start, token.end - it->tok->line_start);
|
||||
}
|
||||
|
||||
if (it->tok->tok_extra_tokens) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue