From a0d8873097a587163887e701c08373a1571f8973 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Fri, 3 May 2013 02:36:24 +0900 Subject: [PATCH] More accurate spans --- src/libsyntax/parse/attr.rs | 2 +- src/libsyntax/parse/common.rs | 2 +- src/libsyntax/parse/parser.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index 037b2c089f4..93584b00d39 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -156,7 +156,7 @@ impl parser_attr for Parser { @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)) } } diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs index 01f80c032e9..1df6860fede 100644 --- a/src/libsyntax/parse/common.rs +++ b/src/libsyntax/parse/common.rs @@ -122,7 +122,7 @@ pub impl Parser { 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() }) } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 8459fc8c627..f0e9634d214 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2445,7 +2445,7 @@ pub impl Parser { } } } - 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 @@ pub impl Parser { rp: None, types: ~[] }; return @spanned(lo, - self.span.hi, + self.last_span.hi, view_path_simple(last, path, self.get_id())); }