We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ae3a477 + 342cd19 commit fe25708Copy full SHA for fe25708
parser/src/python.lalrpop
@@ -387,7 +387,9 @@ MatchStatement: ast::Stmt = {
387
}
388
389
MatchCase: ast::MatchCase = {
390
- <start:@L> "case" <pattern:Patterns> <guard:(Guard)?> ":" <body:Suite> <end:@R> => {
+ <start:@L> "case" <pattern:Patterns> <guard:(Guard)?> ":" <body:Suite> => {
391
+ // SAFETY: `body` is never empty because it is non-optional and `Suite` matches one or more statements.
392
+ let end = body.last().unwrap().end();
393
ast::MatchCase {
394
pattern,
395
guard: guard.map(Box::new),
0 commit comments