None | TI(T.NEWLINE) | TI(T.INDENT) | TI(string=":"),
TI(string="match"),
TI(T.NUMBER | T.STRING | T.FSTRING_START | T.TSTRING_START)
- | TI(T.OP, string="(" | "*" | "[" | "{" | "~" | "...")
+ | TI(T.OP, string="(" | "*" | "-" | "+" | "[" | "{" | "~" | "...")
):
return True
case (
("1", "number"),
],
),
+ (
+ "match +1",
+ [
+ ("match", "soft_keyword"),
+ ("+", "op"),
+ ("1", "number"),
+ ],
+ ),
+ (
+ "match -1",
+ [
+ ("match", "soft_keyword"),
+ ("-", "op"),
+ ("1", "number"),
+ ],
+ ),
]
for code, expected_highlights in cases:
with self.subTest(code=code):
--- /dev/null
+Colorize ``match`` in the :term:`REPL` when followed by a unary ``+`` or ``-`` operator. Patch by Bartosz Sławecki.