From 53884705cbaad44def64b409be1ca7107997f776 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 25 Jul 2017 11:39:41 +1200 Subject: [PATCH] Fix the spans of catch blocks to include the `do` --- src/libsyntax/parse/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d6a57c2874f8b..2cd84d202ffc9 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2243,9 +2243,9 @@ impl<'a> Parser<'a> { attrs); } if self.is_catch_expr() { + let lo = self.span; assert!(self.eat_keyword(keywords::Do)); assert!(self.eat_keyword(keywords::Catch)); - let lo = self.prev_span; return self.parse_catch_expr(lo, attrs); } if self.eat_keyword(keywords::Return) {