```rust
macro_rules! m { () => { let x = 1; x } }
macro_rules! n { () => {
m!() //< This can now expand into statements
}}
fn main() { n!(); }
```
and revert needless fallout fixes.
/// (or the lack thereof) -- c.f. `parse_stmt`.
pub fn finish_parsing_statement(&mut self, mut stmt: Stmt) -> PResult<'a, Stmt> {
if let StmtKind::Mac(mac) = stmt.node {
- if mac.1 != MacStmtStyle::NoBraces || self.token == token::Semi {
+ if mac.1 != MacStmtStyle::NoBraces ||
+ self.token == token::Semi || self.token == token::Eof {
stmt.node = StmtKind::Mac(mac);
} else {
let (mac, _style, attrs) = mac.unwrap();
// product macro
($from: ident $(, $from_: ident)*: $($to: ident),*) => {
fn $from() { unsafe { $( test!($from, $to); )* } }
- tests!($($from_),*: $($to),*);
+ tests!($($from_),*: $($to),*)
};
($($types: ident),*) => {{
tests!($($types),* : $($types),*);