mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-07 21:25:31 +00:00
Merge pull request #76 from astral-sh/match-case-end-location
This commit is contained in:
commit
fe25708d89
2 changed files with 1471 additions and 1497 deletions
|
@ -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
2964
parser/src/python.rs
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue