diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-08-14 19:20:56 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-08-15 16:20:34 -0700 |
| commit | bdb206f2855cc6f7d3d79379633f7429b7327fec (patch) | |
| tree | 05764770b6b2729780bb1289d3c2db55d1cc55c5 /src/libsyntax/fold.rs | |
| parent | d54db12155257787797cd9c7eaf06a215ff516e5 (diff) | |
rustc: Parse labeled loop, break, and again
Diffstat (limited to 'src/libsyntax/fold.rs')
| -rw-r--r-- | src/libsyntax/fold.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 5cce86fd458..5bd35490f0e 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -448,8 +448,9 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ { expr_while(cond, body) => { expr_while(fld.fold_expr(cond), fld.fold_block(body)) } - expr_loop(body) => { - expr_loop(fld.fold_block(body)) + expr_loop(body, opt_ident) => { + expr_loop(fld.fold_block(body), + option::map(opt_ident, |x| fld.fold_ident(x))) } expr_match(expr, arms, mode) => { expr_match(fld.fold_expr(expr), @@ -492,7 +493,10 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ { } expr_path(pth) => expr_path(fld.fold_path(pth)), expr_fail(e) => expr_fail(option::map(e, |x| fld.fold_expr(x))), - expr_break | expr_again => copy e, + expr_break(opt_ident) => + expr_break(option::map(opt_ident, |x| fld.fold_ident(x))), + expr_again(opt_ident) => + expr_again(option::map(opt_ident, |x| fld.fold_ident(x))), expr_ret(e) => expr_ret(option::map(e, |x| fld.fold_expr(x))), expr_log(i, lv, e) => expr_log(i, fld.fold_expr(lv), fld.fold_expr(e)), |
