Start the span for a path in a view_path at the correct place (at the start of the path, rather than at the start of the view_path).

This commit is contained in:
Nick Cameron 2014-01-09 20:12:23 +13:00
parent 7613b15fdb
commit 01f42eed80

View file

@ -4925,6 +4925,7 @@ impl Parser {
token::EQ => { token::EQ => {
// x = foo::bar // x = foo::bar
self.bump(); self.bump();
let path_lo = self.span.lo;
path = ~[self.parse_ident()]; path = ~[self.parse_ident()];
while self.token == token::MOD_SEP { while self.token == token::MOD_SEP {
self.bump(); self.bump();
@ -4932,7 +4933,7 @@ impl Parser {
path.push(id); path.push(id);
} }
let path = ast::Path { let path = ast::Path {
span: mk_sp(lo, self.span.hi), span: mk_sp(path_lo, self.span.hi),
global: false, global: false,
segments: path.move_iter().map(|identifier| { segments: path.move_iter().map(|identifier| {
ast::PathSegment { ast::PathSegment {