Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expect indented case block instead of match stmt #11033

Merged
merged 1 commit into from Apr 19, 2024
Merged

Conversation

dhruvmanila
Copy link
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
17 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/case-block branch April 19, 2024 11:16
Copy link
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.

None yet

2 participants