]> git.lizzy.rs Git - rust.git/commitdiff
More accurate spans
authorSeo Sanghyeon <sanxiyn@gmail.com>
Thu, 2 May 2013 17:36:24 +0000 (02:36 +0900)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Thu, 2 May 2013 17:36:24 +0000 (02:36 +0900)
src/libsyntax/parse/attr.rs
src/libsyntax/parse/common.rs
src/libsyntax/parse/parser.rs

index 037b2c089f46a6936c2bce7b8ea704be98fbf4a8..93584b00d39e638622927c91c8d6fe320df04b21 100644 (file)
@@ -156,7 +156,7 @@ fn parse_meta_item(&self) -> @ast::meta_item {
                 @spanned(lo, hi, ast::meta_list(name, inner_items))
             }
             _ => {
-                let hi = self.span.hi;
+                let hi = self.last_span.hi;
                 @spanned(lo, hi, ast::meta_word(name))
             }
         }
index 01f80c032e9a0b78ac68ddea8de14173d95438aa..1df6860fedee97c74de825b671458ef5f55b6dcd 100644 (file)
@@ -122,7 +122,7 @@ fn parse_ident(&self) -> ast::ident {
     fn parse_path_list_ident(&self) -> ast::path_list_ident {
         let lo = self.span.lo;
         let ident = self.parse_ident();
-        let hi = self.span.hi;
+        let hi = self.last_span.hi;
         spanned(lo, hi, ast::path_list_ident_ { name: ident,
                                                 id: self.get_id() })
     }
index 8459fc8c6273d74aebae5edfd1ec8dcdb5d3d5de..f0e9634d214d6de7597dcc3fa2ee9c4b9a8b8034 100644 (file)
@@ -2445,7 +2445,7 @@ fn parse_pat(&self, refutable: bool) -> @pat {
                     }
                 }
             }
-            hi = self.span.hi;
+            hi = self.last_span.hi;
           }
         }
         @ast::pat { id: self.get_id(), node: pat, span: mk_sp(lo, hi) }
@@ -4311,7 +4311,7 @@ fn parse_view_path(&self) -> @view_path {
                                 rp: None,
                                 types: ~[] };
         return @spanned(lo,
-                        self.span.hi,
+                        self.last_span.hi,
                         view_path_simple(last, path, self.get_id()));
     }