mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-09 06:04:54 +08:00
Fix an issue that created an endless loop.
This commit is contained in:
@@ -144,11 +144,11 @@ def _tokenize(code, start_pos=(1, 0)):
|
|||||||
search *= 3
|
search *= 3
|
||||||
start += 2
|
start += 2
|
||||||
|
|
||||||
index = code.find(search)
|
index = code.find(search, start)
|
||||||
if index == -1:
|
if index == -1:
|
||||||
index = len(code)
|
index = len(code)
|
||||||
expression += code[start:index]
|
expression += code[start:index]
|
||||||
start = index
|
start = index + 1
|
||||||
elif found == '!' and len(code) > start and code[start] == '=':
|
elif found == '!' and len(code) > start and code[start] == '=':
|
||||||
# This is a python `!=` and not a conversion.
|
# This is a python `!=` and not a conversion.
|
||||||
expression += found
|
expression += found
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ FAILING_EXAMPLES = [
|
|||||||
# f-strings
|
# f-strings
|
||||||
'f"{}"',
|
'f"{}"',
|
||||||
'f"{\\}"',
|
'f"{\\}"',
|
||||||
#'f"{\'\\\'}"',
|
'f"{\'\\\'}"',
|
||||||
'f"{#}"',
|
'f"{#}"',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user