mirror of
https://github.com/python/cpython.git
synced 2025-11-08 17:41:42 +00:00
[3.14] gh-136801: Fix PyREPL syntax highlightning on match cases after multi-line case (GH-136804) (GH-136813)
(cherry picked from commit 3a64844533)
Co-authored-by: Olga Matoula <olgamatoula@gmail.com>
This commit is contained in:
parent
03457ca2ac
commit
2a9aeb0f57
3 changed files with 10 additions and 7 deletions
|
|
@ -241,14 +241,14 @@ def is_soft_keyword_used(*tokens: TI | None) -> bool:
|
|||
return s in keyword_first_sets_match
|
||||
return True
|
||||
case (
|
||||
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(string=":"),
|
||||
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(T.DEDENT) | TI(string=":"),
|
||||
TI(string="case"),
|
||||
TI(T.NUMBER | T.STRING | T.FSTRING_START | T.TSTRING_START)
|
||||
| TI(T.OP, string="(" | "*" | "-" | "[" | "{")
|
||||
):
|
||||
return True
|
||||
case (
|
||||
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(string=":"),
|
||||
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(T.DEDENT) | TI(string=":"),
|
||||
TI(string="case"),
|
||||
TI(T.NAME, string=s)
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue