File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ def is_soft_keyword_used(*tokens: TI | None) -> bool:
259259 None | TI (T .NEWLINE ) | TI (T .INDENT ) | TI (string = ":" ),
260260 TI (string = "match" ),
261261 TI (T .NUMBER | T .STRING | T .FSTRING_START | T .TSTRING_START )
262- | TI (T .OP , string = "(" | "*" | "[" | "{" | "~" | "..." )
262+ | TI (T .OP , string = "(" | "*" | "-" | "+" | " [" | "{" | "~" | "..." )
263263 ):
264264 return True
265265 case (
Original file line number Diff line number Diff line change @@ -133,6 +133,22 @@ def test_gen_colors_keyword_highlighting(self):
133133 ("1" , "number" ),
134134 ],
135135 ),
136+ (
137+ "match +1" ,
138+ [
139+ ("match" , "soft_keyword" ),
140+ ("+" , "op" ),
141+ ("1" , "number" ),
142+ ],
143+ ),
144+ (
145+ "match -1" ,
146+ [
147+ ("match" , "soft_keyword" ),
148+ ("-" , "op" ),
149+ ("1" , "number" ),
150+ ],
151+ ),
136152 ]
137153 for code , expected_highlights in cases :
138154 with self .subTest (code = code ):
You can’t perform that action at this time.
0 commit comments