gh-105820: Fix tok_mode expression buffer in file & readline tokenizer (#105828)

This commit is contained in:
Lysandros Nikolaou 2023-06-15 18:21:24 +02:00 committed by GitHub
parent 8f10140e74
commit d382ad4915
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 4 deletions

View file

@ -558,6 +558,19 @@ def"', """\
OP '}' (1, 39) (1, 40)
FSTRING_MIDDLE ' final words' (1, 40) (1, 52)
FSTRING_END "'" (1, 52) (1, 53)
""")
self.check_tokenize("""\
f'''{
3
=}'''""", """\
FSTRING_START "f'''" (1, 0) (1, 4)
OP '{' (1, 4) (1, 5)
NL '\\n' (1, 5) (1, 6)
NUMBER '3' (2, 0) (2, 1)
NL '\\n' (2, 1) (2, 2)
OP '=' (3, 0) (3, 1)
OP '}' (3, 1) (3, 2)
FSTRING_END "'''" (3, 2) (3, 5)
""")
def test_function(self):