1
Fork 0

Allow for macros to occur in statement position.

This commit is contained in:
Paul Stansifer 2012-11-12 23:06:55 -05:00 committed by Graydon Hoare
parent fca52554e7
commit ee076f63f9
13 changed files with 33 additions and 17 deletions

View file

@ -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))
};
}