Skip to content

Expect indented case block instead of match stmt#11033

Merged
dhruvmanila merged 1 commit intomainfrom
dhruv/case-block
Apr 19, 2024
Merged

Expect indented case block instead of match stmt#11033
dhruvmanila merged 1 commit intomainfrom
dhruv/case-block

Conversation

@dhruvmanila
Copy link
Copy Markdown
Member

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.

@dhruvmanila dhruvmanila added the parser Related to the parser label Apr 19, 2024
@dhruvmanila dhruvmanila merged commit 9bb23b0 into main Apr 19, 2024
@dhruvmanila dhruvmanila deleted the dhruv/case-block branch April 19, 2024 11:16
@github-actions
Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parser Related to the parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants