More accurate spans
This commit is contained in:
parent
b42ea7f9ef
commit
a0d8873097
3 changed files with 4 additions and 4 deletions
|
@ -156,7 +156,7 @@ impl parser_attr for Parser {
|
||||||
@spanned(lo, hi, ast::meta_list(name, inner_items))
|
@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))
|
@spanned(lo, hi, ast::meta_word(name))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ pub impl Parser {
|
||||||
fn parse_path_list_ident(&self) -> ast::path_list_ident {
|
fn parse_path_list_ident(&self) -> ast::path_list_ident {
|
||||||
let lo = self.span.lo;
|
let lo = self.span.lo;
|
||||||
let ident = self.parse_ident();
|
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,
|
spanned(lo, hi, ast::path_list_ident_ { name: ident,
|
||||||
id: self.get_id() })
|
id: self.get_id() })
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) }
|
@ast::pat { id: self.get_id(), node: pat, span: mk_sp(lo, hi) }
|
||||||
|
@ -4311,7 +4311,7 @@ pub impl Parser {
|
||||||
rp: None,
|
rp: None,
|
||||||
types: ~[] };
|
types: ~[] };
|
||||||
return @spanned(lo,
|
return @spanned(lo,
|
||||||
self.span.hi,
|
self.last_span.hi,
|
||||||
view_path_simple(last, path, self.get_id()));
|
view_path_simple(last, path, self.get_id()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue