gh-120343: Do not reset byte_col_offset_diff after multiline tokens (#120352)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
Lysandros Nikolaou 2024-06-11 19:00:53 +02:00 committed by GitHub
parent 32a0faba43
commit 1b62bcee94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 1 deletions

View file

@ -1199,6 +1199,17 @@ async def f():
NAME 'x' (1, 3) (1, 4)
""")
def test_multiline_non_ascii_fstring(self):
self.check_tokenize("""\
a = f'''
Autorzy, którzy jednostkę mają wpisani jako AKTUALNA -- czyli'''""", """\
NAME 'a' (1, 0) (1, 1)
OP '=' (1, 2) (1, 3)
FSTRING_START "f\'\'\'" (1, 4) (1, 8)
FSTRING_MIDDLE '\\n Autorzy, którzy tą jednostkę mają wpisani jako AKTUALNA -- czyli' (1, 8) (2, 68)
FSTRING_END "\'\'\'" (2, 68) (2, 71)
""")
class GenerateTokensTest(TokenizeTest):
def check_tokenize(self, s, expected):
# Format the tokens in s in a table format.