mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:34:40 +00:00
Expect indented case block instead of match stmt (#11033)
## Summary This PR adds a new `Clause::Case` and uses it to parse the body of a `case` block. Earlier, it was using `Match` which would give an incorrect error message like: ``` | 1 | match subject: 2 | case 1: 3 | case 2: ... | ^^^^ Syntax Error: Expected an indented block after `match` statement | ``` ## Test Plan Add test case and update the snapshot.
This commit is contained in:
parent
06c248a126
commit
9bb23b0a38
3 changed files with 95 additions and 3 deletions
|
@ -0,0 +1,3 @@
|
|||
match subject:
|
||||
case 1:
|
||||
case 2: ...
|
Loading…
Add table
Add a link
Reference in a new issue