/// Expr with trailing semi-colon (may have any type):
StmtSemi(P<Expr>, NodeId),
- StmtMac(Mac, MacStmtStyle),
+ StmtMac(P<Mac>, MacStmtStyle),
}
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
StmtMac(mac, style) => (mac, style),
_ => return expand_non_macro_stmt(s, fld)
};
- let expanded_stmt = match expand_mac_invoc(mac, s.span,
+ let expanded_stmt = match expand_mac_invoc(mac.and_then(|m| m), s.span,
|r| r.make_stmt(),
mark_stmt, fld) {
Some(stmt) => stmt,
}))
}
StmtMac(mac, semi) => SmallVector::one(P(Spanned {
- node: StmtMac(folder.fold_mac(mac), semi),
+ node: StmtMac(mac.map(|m| folder.fold_mac(m)), semi),
span: span
}))
}
expr = Some(
self.mk_mac_expr(span.lo,
span.hi,
- m.node));
+ m.and_then(|x| x.node)));
}
_ => {
stmts.push(P(Spanned {
ast::MacStmtWithBraces => token::Brace,
_ => token::Paren
};
- try!(self.print_mac(mac, delim));
+ try!(self.print_mac(&**mac, delim));
match style {
ast::MacStmtWithBraces => {}
_ => try!(word(&mut self.s, ";")),
StmtExpr(ref expression, _) | StmtSemi(ref expression, _) => {
visitor.visit_expr(&**expression)
}
- StmtMac(ref macro, _) => visitor.visit_mac(macro),
+ StmtMac(ref macro, _) => visitor.visit_mac(&**macro),
}
}