Refactor away field ctxt of ast::Mac_

This commit is contained in:
Jeffrey Seyfried 2016-05-24 11:38:39 +00:00
parent 01a0877a73
commit febe6a46f6
4 changed files with 8 additions and 11 deletions

View file

@ -17,7 +17,7 @@ use ast::Block;
use ast::{BlockCheckMode, CaptureBy};
use ast::{Constness, Crate, CrateConfig};
use ast::{Decl, DeclKind, Defaultness};
use ast::{EMPTY_CTXT, EnumDef};
use ast::EnumDef;
use ast::{Expr, ExprKind, RangeLimits};
use ast::{Field, FnDecl};
use ast::{ForeignItem, ForeignItemKind, FunctionRetTy};
@ -1467,7 +1467,7 @@ impl<'a> Parser<'a> {
SeqSep::none(),
|p| p.parse_token_tree())?;
let hi = self.span.hi;
TyKind::Mac(spanned(lo, hi, Mac_ { path: path, tts: tts, ctxt: EMPTY_CTXT }))
TyKind::Mac(spanned(lo, hi, Mac_ { path: path, tts: tts }))
} else {
// NAMED TYPE
TyKind::Path(None, path)
@ -2348,7 +2348,7 @@ impl<'a> Parser<'a> {
return Ok(self.mk_mac_expr(lo,
hi,
Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT },
Mac_ { path: pth, tts: tts },
attrs));
}
if self.check(&token::OpenDelim(token::Brace)) {
@ -3661,7 +3661,7 @@ impl<'a> Parser<'a> {
let tts = self.parse_seq_to_end(
&token::CloseDelim(delim),
SeqSep::none(), |p| p.parse_token_tree())?;
let mac = Mac_ { path: path, tts: tts, ctxt: EMPTY_CTXT };
let mac = Mac_ { path: path, tts: tts };
pat = PatKind::Mac(codemap::Spanned {node: mac,
span: mk_sp(lo, self.last_span.hi)});
} else {
@ -3979,7 +3979,7 @@ impl<'a> Parser<'a> {
};
if id.name == keywords::Invalid.name() {
let mac = P(spanned(lo, hi, Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT }));
let mac = P(spanned(lo, hi, Mac_ { path: pth, tts: tts }));
let stmt = StmtKind::Mac(mac, style, attrs.into_thin_attrs());
spanned(lo, hi, stmt)
} else {
@ -4000,7 +4000,7 @@ impl<'a> Parser<'a> {
self.mk_item(
lo, hi, id /*id is good here*/,
ItemKind::Mac(spanned(lo, hi,
Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT })),
Mac_ { path: pth, tts: tts })),
Visibility::Inherited, attrs)))),
ast::DUMMY_NODE_ID))
}
@ -4913,7 +4913,7 @@ impl<'a> Parser<'a> {
let tts = self.parse_seq_to_end(&token::CloseDelim(delim),
SeqSep::none(),
|p| p.parse_token_tree())?;
let m_ = Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT };
let m_ = Mac_ { path: pth, tts: tts };
let m: ast::Mac = codemap::Spanned { node: m_,
span: mk_sp(lo,
self.last_span.hi) };
@ -6002,7 +6002,7 @@ impl<'a> Parser<'a> {
SeqSep::none(),
|p| p.parse_token_tree())?;
// single-variant-enum... :
let m = Mac_ { path: pth, tts: tts, ctxt: EMPTY_CTXT };
let m = Mac_ { path: pth, tts: tts };
let m: ast::Mac = codemap::Spanned { node: m,
span: mk_sp(mac_lo,
self.last_span.hi) };