Skip to content

Commit 73830e4

Browse files
committed
add temporarily unused ctxt field to mac_invoc_tt
1 parent dc41afa commit 73830e4

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ pub type mac = Spanned<mac_>;
648648
// There's only one flavor, now, so this could presumably be simplified.
649649
#[deriving(Clone, Eq, Encodable, Decodable, IterBytes)]
650650
pub enum mac_ {
651-
mac_invoc_tt(Path,~[token_tree]), // new macro-invocation
651+
mac_invoc_tt(Path,~[token_tree],SyntaxContext), // new macro-invocation
652652
}
653653

654654
pub type lit = Spanned<lit_>;

src/libsyntax/ext/expand.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn expand_expr(extsbox: @mut SyntaxEnv,
4343
ExprMac(ref mac) => {
4444
match (*mac).node {
4545
// Token-tree macros:
46-
mac_invoc_tt(ref pth, ref tts) => {
46+
mac_invoc_tt(ref pth, ref tts, ctxt) => {
4747
if (pth.segments.len() > 1u) {
4848
cx.span_fatal(
4949
pth.span,
@@ -368,7 +368,7 @@ pub fn expand_item_mac(extsbox: @mut SyntaxEnv,
368368
fld: @ast_fold)
369369
-> Option<@ast::item> {
370370
let (pth, tts) = match it.node {
371-
item_mac(codemap::Spanned { node: mac_invoc_tt(ref pth, ref tts), _}) => {
371+
item_mac(codemap::Spanned { node: mac_invoc_tt(ref pth, ref tts, ctxt), _}) => {
372372
(pth, (*tts).clone())
373373
}
374374
_ => cx.span_bug(it.span, "invalid item macro invocation")
@@ -471,7 +471,7 @@ pub fn expand_stmt(extsbox: @mut SyntaxEnv,
471471
let (mac, pth, tts, semi) = match *s {
472472
StmtMac(ref mac, semi) => {
473473
match mac.node {
474-
mac_invoc_tt(ref pth, ref tts) => {
474+
mac_invoc_tt(ref pth, ref tts, ctxt) => {
475475
((*mac).clone(), pth, (*tts).clone(), semi)
476476
}
477477
}

src/libsyntax/fold.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@ fn fold_arg_(a: arg, fld: @ast_fold) -> arg {
116116
fn fold_mac_(m: &mac, fld: @ast_fold) -> mac {
117117
Spanned {
118118
node: match m.node {
119-
mac_invoc_tt(ref p,ref tts) =>
119+
mac_invoc_tt(ref p,ref tts,ctxt) =>
120120
mac_invoc_tt(fld.fold_path(p),
121-
fold_tts(*tts,|id|{fld.fold_ident(id)}))
121+
fold_tts(*tts,|id|{fld.fold_ident(id)}),
122+
ctxt)
122123
},
123124
span: fld.new_span(m.span)
124125
}

src/libsyntax/parse/parser.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use ast::{_mod, BiAdd, arg, Arm, Attribute, BindByRef, BindInfer};
2121
use ast::{BiBitAnd, BiBitOr, BiBitXor, Block};
2222
use ast::{BlockCheckMode, UnBox};
2323
use ast::{Crate, CrateConfig, Decl, DeclItem};
24-
use ast::{DeclLocal, DefaultBlock, UnDeref, BiDiv, enum_def, explicit_self};
24+
use ast::{DeclLocal, DefaultBlock, UnDeref, BiDiv, EMPTY_CTXT, enum_def, explicit_self};
2525
use ast::{Expr, Expr_, ExprAddrOf, ExprMatch, ExprAgain};
2626
use ast::{ExprAssign, ExprAssignOp, ExprBinary, ExprBlock};
2727
use ast::{ExprBreak, ExprCall, ExprCast, ExprDoBody};
@@ -1875,7 +1875,7 @@ impl Parser {
18751875
|p| p.parse_token_tree());
18761876
let hi = self.span.hi;
18771877

1878-
return self.mk_mac_expr(lo, hi, mac_invoc_tt(pth, tts));
1878+
return self.mk_mac_expr(lo, hi, mac_invoc_tt(pth, tts, EMPTY_CTXT));
18791879
} else if *self.token == token::LBRACE {
18801880
// This might be a struct literal.
18811881
if self.looking_at_record_literal() {
@@ -3197,14 +3197,14 @@ impl Parser {
31973197

31983198
if id == token::special_idents::invalid {
31993199
return @spanned(lo, hi, StmtMac(
3200-
spanned(lo, hi, mac_invoc_tt(pth, tts)), false));
3200+
spanned(lo, hi, mac_invoc_tt(pth, tts, EMPTY_CTXT)), false));
32013201
} else {
32023202
// if it has a special ident, it's definitely an item
32033203
return @spanned(lo, hi, StmtDecl(
32043204
@spanned(lo, hi, DeclItem(
32053205
self.mk_item(
32063206
lo, hi, id /*id is good here*/,
3207-
item_mac(spanned(lo, hi, mac_invoc_tt(pth, tts))),
3207+
item_mac(spanned(lo, hi, mac_invoc_tt(pth, tts, EMPTY_CTXT))),
32083208
inherited, ~[/*no attrs*/]))),
32093209
self.get_id()));
32103210
}
@@ -4809,7 +4809,7 @@ impl Parser {
48094809
_ => self.fatal("expected open delimiter")
48104810
};
48114811
// single-variant-enum... :
4812-
let m = ast::mac_invoc_tt(pth, tts);
4812+
let m = ast::mac_invoc_tt(pth, tts, EMPTY_CTXT);
48134813
let m: ast::mac = codemap::Spanned { node: m,
48144814
span: mk_sp(self.span.lo,
48154815
self.span.hi) };

src/libsyntax/print/pprust.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ pub fn print_item(s: @ps, item: &ast::item) {
619619
}
620620
bclose(s, item.span);
621621
}
622-
ast::item_mac(codemap::Spanned { node: ast::mac_invoc_tt(ref pth, ref tts),
622+
ast::item_mac(codemap::Spanned { node: ast::mac_invoc_tt(ref pth, ref tts, ctxt),
623623
_}) => {
624624
print_visibility(s, item.vis);
625625
print_path(s, pth, false);
@@ -1021,7 +1021,7 @@ pub fn print_if(s: @ps, test: &ast::Expr, blk: &ast::Block,
10211021

10221022
pub fn print_mac(s: @ps, m: &ast::mac) {
10231023
match m.node {
1024-
ast::mac_invoc_tt(ref pth, ref tts) => {
1024+
ast::mac_invoc_tt(ref pth, ref tts, ctxt) => {
10251025
print_path(s, pth, false);
10261026
word(s.s, "!");
10271027
popen(s);

0 commit comments

Comments
 (0)