mirror of
https://github.com/python/cpython.git
synced 2025-10-20 08:23:47 +00:00
gh-136801: Fix PyREPL syntax highlightning on match cases after multi-line case (GH-136804)
This commit is contained in:
parent
6a1c93af80
commit
3a64844533
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