mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-138239: Fix incorrect highlighting of "type" in type statements in the REPL (GH-138241) (GH-138937)
(cherry picked from commit 26cfb17942)
Co-authored-by: 00ll00 <40747228+00ll00@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
e953cead61
commit
61d49a5d37
3 changed files with 13 additions and 3 deletions
|
|
@ -264,6 +264,12 @@ def is_soft_keyword_used(*tokens: TI | None) -> bool:
|
|||
return True
|
||||
case (TI(string="case"), TI(string="_"), TI(string=":")):
|
||||
return True
|
||||
case (
|
||||
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(T.DEDENT) | TI(string=":"),
|
||||
TI(string="type"),
|
||||
TI(T.NAME, string=s)
|
||||
):
|
||||
return not keyword.iskeyword(s)
|
||||
case _:
|
||||
return False
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue