Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsalpablogsal commented Dec 11, 2023

}
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);
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it->tok->line_start holds the last line tokenised (the last line of the multi-line string) while line holds the entire multi-line string from the start to the end.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@pablogsalpablogsal enabled auto-merge (squash) December 11, 2023 11:24
@pablogsalpablogsal merged commit a135a6d into python:mainDec 11, 2023
@pablogsalpablogsal deleted the gh-112943 branch December 11, 2023 11:44
@miss-islington-app
Copy link

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app
Copy link

Sorry, @pablogsal, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker a135a6d2c6d503b186695f01efa7eed65611b04e 3.12 

@bedevere-app
Copy link

GH-112957 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12 only security fixes label Dec 11, 2023
pablogsal added a commit to pablogsal/cpython that referenced this pull request Dec 11, 2023
…okens in the tokenize module (pythonGH-112949) (cherry picked from commit a135a6d) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit that referenced this pull request Dec 11, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@pablogsal@serhiy-storchaka