Skip to content

Commit

Permalink
Fix span of top-level patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
osa1 committed Feb 6, 2024
1 parent 41d2ba5 commit d6781e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/h10/src/parser/decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ impl Parser {
self.spanned(l, r, Lhs_::Fun { var, pats })
})
.or_else(|_| {
let (_, r) = self.last_tok_span();
let pat = self.pat_try()?;
Ok(self.spanned(l, r, Lhs_::Pat(pat)))
let pat_span = pat.span.clone();
Ok(self.spanned(pat_span.start, pat_span.end, Lhs_::Pat(pat)))
})
.or_else(|_: Error| self.fail_with_next(ErrorKind::UnexpectedToken))?;

Expand Down

0 comments on commit d6781e5

Please sign in to comment.