mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-02 00:07:42 +03:00
Use last_span for macro spans
This commit is contained in:
@@ -3253,7 +3253,8 @@ pub fn parse_pat(&mut self) -> PResult<P<Pat>> {
|
||||
let tts = try!(self.parse_seq_to_end(&token::CloseDelim(delim),
|
||||
seq_sep_none(), |p| p.parse_token_tree()));
|
||||
let mac = Mac_ { path: path, tts: tts, ctxt: EMPTY_CTXT };
|
||||
pat = PatMac(codemap::Spanned {node: mac, span: mk_sp(lo, self.span.hi)});
|
||||
pat = PatMac(codemap::Spanned {node: mac,
|
||||
span: mk_sp(lo, self.last_span.hi)});
|
||||
} else {
|
||||
// Parse ident @ pat
|
||||
// This can give false positives and parse nullary enums,
|
||||
@@ -4487,7 +4488,7 @@ fn parse_impl_method(&mut self, vis: Visibility)
|
||||
let m_ = Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT };
|
||||
let m: ast::Mac = codemap::Spanned { node: m_,
|
||||
span: mk_sp(lo,
|
||||
self.span.hi) };
|
||||
self.last_span.hi) };
|
||||
if delim != token::Brace {
|
||||
try!(self.expect(&token::Semi))
|
||||
}
|
||||
@@ -5537,7 +5538,7 @@ fn parse_macro_use_or_failure(
|
||||
let m = Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT };
|
||||
let m: ast::Mac = codemap::Spanned { node: m,
|
||||
span: mk_sp(mac_lo,
|
||||
self.span.hi) };
|
||||
self.last_span.hi) };
|
||||
|
||||
if delim != token::Brace {
|
||||
if !try!(self.eat(&token::Semi) ){
|
||||
|
||||
Reference in New Issue
Block a user