Allow for macros to occur in statement position.
This commit is contained in:
parent
fca52554e7
commit
ee076f63f9
13 changed files with 33 additions and 17 deletions
|
@ -305,10 +305,12 @@ fn noop_fold_block(b: blk_, fld: ast_fold) -> blk_ {
|
|||
}
|
||||
|
||||
fn noop_fold_stmt(s: stmt_, fld: ast_fold) -> stmt_ {
|
||||
let fold_mac = |x| fold_mac_(x, fld);
|
||||
return match s {
|
||||
stmt_decl(d, nid) => stmt_decl(fld.fold_decl(d), fld.new_id(nid)),
|
||||
stmt_expr(e, nid) => stmt_expr(fld.fold_expr(e), fld.new_id(nid)),
|
||||
stmt_semi(e, nid) => stmt_semi(fld.fold_expr(e), fld.new_id(nid))
|
||||
stmt_semi(e, nid) => stmt_semi(fld.fold_expr(e), fld.new_id(nid)),
|
||||
stmt_mac(mac) => stmt_mac(fold_mac(mac))
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue