Merge pull request #76 from astral-sh/match-case-end-location

This commit is contained in:
Micha Reiser 2023-05-31 09:48:42 +02:00 committed by GitHub
commit fe25708d89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1471 additions and 1497 deletions

View file

@ -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),

2964
parser/src/python.rs generated

File diff suppressed because it is too large Load diff