about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorKevin Yeh <kevinyeah@utexas.edu>2015-11-28 22:36:37 -0600
committerKevin Yeh <kevinyeah@utexas.edu>2015-11-28 23:54:54 -0600
commit920120ed4ce2389b0db5cdabb3eb60535da5836d (patch)
tree50e2fb5df62b43a62ceaf1071dd9e473babde2f9 /src/libsyntax/parse
parentb4295b9fb0789b9c354d17457dc60a7ca13119a6 (diff)
downloadrust-920120ed4ce2389b0db5cdabb3eb60535da5836d.tar.gz
rust-920120ed4ce2389b0db5cdabb3eb60535da5836d.zip
Use last_span for macro spans
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 74b8fdea538..ce65f99e2f0 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3253,7 +3253,8 @@ impl<'a> Parser<'a> {
                         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 @@ impl<'a> Parser<'a> {
             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 @@ impl<'a> Parser<'a> {
             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) ){