We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
case +
1 parent ce916dc commit ff64d8dCopy full SHA for ff64d8d
2 files changed
Lib/_pyrepl/utils.py
@@ -274,7 +274,7 @@ def is_soft_keyword_used(*tokens: TI | None) -> bool:
274
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(T.DEDENT) | TI(string=":"),
275
TI(string="case"),
276
TI(T.NUMBER | T.STRING | T.FSTRING_START | T.TSTRING_START)
277
- | TI(T.OP, string="(" | "*" | "-" | "[" | "{")
+ | TI(T.OP, string="(" | "*" | "-" | "+" | "[" | "{")
278
):
279
return True
280
case (
Lib/test/test_pyrepl/test_utils.py
@@ -125,6 +125,14 @@ def test_gen_colors_keyword_highlighting(self):
125
("import", "keyword"),
126
],
127
),
128
+ (
129
+ "case +1",
130
+ [
131
+ ("case", "soft_keyword"),
132
+ ("+", "op"),
133
+ ("1", "number"),
134
+ ],
135
+ ),
136
]
137
for code, expected_highlights in cases:
138
with self.subTest(code=code):
0 commit comments