Fix overly long spans for break and continue

The spans of break and continue would include the next token.
This commit is contained in:
Marcus Klaas 2015-08-31 00:26:02 +02:00
parent 811868ec6f
commit 3a360fca78

View File

@ -2149,7 +2149,7 @@ impl<'a> Parser<'a> {
} else {
ExprAgain(None)
};
let hi = self.span.hi;
let hi = self.last_span.hi;
return Ok(self.mk_expr(lo, hi, ex));
}
if try!(self.eat_keyword(keywords::Match) ){
@ -2178,7 +2178,7 @@ impl<'a> Parser<'a> {
} else {
ex = ExprBreak(None);
}
hi = self.span.hi;
hi = self.last_span.hi;
} else if self.check(&token::ModSep) ||
self.token.is_ident() &&
!self.check_keyword(keywords::True) &&