]> git.lizzy.rs Git - rust.git/commitdiff
Correct span for self and ExprStruct
authorSeo Sanghyeon <sanxiyn@gmail.com>
Tue, 11 Feb 2014 13:49:50 +0000 (22:49 +0900)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Tue, 11 Feb 2014 13:49:50 +0000 (22:49 +0900)
src/libsyntax/parse/parser.rs

index 507debc8ce0b567d53c80fc2dc9c048bdb05e8b0..4bef7dc5bb5edd12f9fa0dc3afc690bebfa150b4 100644 (file)
@@ -1799,7 +1799,7 @@ pub fn parse_bottom_expr(&mut self) -> @Expr {
         } else if self.eat_keyword(keywords::Self) {
             let path = ast_util::ident_to_path(mk_sp(lo, hi), special_idents::self_);
             ex = ExprPath(path);
-            hi = self.span.hi;
+            hi = self.last_span.hi;
         } else if self.eat_keyword(keywords::If) {
             return self.parse_if_expr();
         } else if self.eat_keyword(keywords::For) {
@@ -1934,7 +1934,7 @@ pub fn parse_bottom_expr(&mut self) -> @Expr {
                                          &[token::COMMA], &[token::RBRACE]);
                     }
 
-                    hi = pth.span.hi;
+                    hi = self.span.hi;
                     self.expect(&token::RBRACE);
                     ex = ExprStruct(pth, fields, base);
                     return self.mk_expr(lo, hi, ex);