about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMarcus Klaas <mail@marcusklaas.nl>2015-08-31 00:26:02 +0200
committerMarcus Klaas <mail@marcusklaas.nl>2015-09-02 20:55:17 +0200
commit3a360fca78b415d31783ec715a2c9024a89eeb75 (patch)
treee2d3afd6fb7ee831f1f82a322efe2a419e62a55d /src/libsyntax/parse
parent811868ec6fcde0a2e43025542e8fd87e74f64d0b (diff)
downloadrust-3a360fca78b415d31783ec715a2c9024a89eeb75.tar.gz
rust-3a360fca78b415d31783ec715a2c9024a89eeb75.zip
Fix overly long spans for break and continue
The spans of break and continue would include the next token.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 4966215a9f2..0772d124db8 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -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) &&