Skip to content

Commit

Permalink
Merge pull request #76 from astral-sh/match-case-end-location
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored May 31, 2023
2 parents ae3a477 + 342cd19 commit fe25708
Show file tree
Hide file tree
Showing 2 changed files with 1,203 additions and 1,229 deletions.
4 changes: 3 additions & 1 deletion parser/src/python.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ MatchStatement: ast::Stmt = {
}

MatchCase: ast::MatchCase = {
<start:@L> "case" <pattern:Patterns> <guard:(Guard)?> ":" <body:Suite> <end:@R> => {
<start:@L> "case" <pattern:Patterns> <guard:(Guard)?> ":" <body:Suite> => {
// SAFETY: `body` is never empty because it is non-optional and `Suite` matches one or more statements.
let end = body.last().unwrap().end();
ast::MatchCase {
pattern,
guard: guard.map(Box::new),
Expand Down
Loading

0 comments on commit fe25708

Please sign in to comment.