diff options
| author | Graydon Hoare <[email protected]> | 2011-02-14 17:46:28 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-02-14 17:46:28 -0800 |
| commit | f1f33abdeba156523d6db1752bbff75dc4088724 (patch) | |
| tree | 9591e536c2a2197756c36859727b20fd0af19cde /src/comp/middle/trans.rs | |
| parent | Adjust commented-out diagnostic log statement in parser.rs. (diff) | |
| download | rust-f1f33abdeba156523d6db1752bbff75dc4088724.tar.xz rust-f1f33abdeba156523d6db1752bbff75dc4088724.zip | |
Move all non-decl/non-expr stmts to exprs.
Diffstat (limited to 'src/comp/middle/trans.rs')
| -rw-r--r-- | src/comp/middle/trans.rs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 1bf278a7..e140ddcc 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -3106,6 +3106,26 @@ fn trans_expr(@block_ctxt cx, @ast.expr e) -> result { ret trans_rec(cx, args, base, ann); } + case (ast.expr_fail) { + ret trans_fail(cx, e.span, "explicit failure"); + } + + case (ast.expr_log(?a)) { + ret trans_log(cx, a); + } + + case (ast.expr_check_expr(?a)) { + ret trans_check_expr(cx, a); + } + + case (ast.expr_ret(?e)) { + ret trans_ret(cx, e); + } + + case (ast.expr_be(?e)) { + ret trans_be(cx, e); + } + // lval cases fall through to trans_lval and then // possibly load the result (if it's non-structural). @@ -3255,26 +3275,6 @@ fn init_local(@block_ctxt cx, @ast.local local) -> result { fn trans_stmt(@block_ctxt cx, &ast.stmt s) -> result { auto bcx = cx; alt (s.node) { - case (ast.stmt_log(?a)) { - bcx = trans_log(cx, a).bcx; - } - - case (ast.stmt_check_expr(?a)) { - bcx = trans_check_expr(cx, a).bcx; - } - - case (ast.stmt_fail) { - bcx = trans_fail(cx, s.span, "explicit failure").bcx; - } - - case (ast.stmt_ret(?e)) { - bcx = trans_ret(cx, e).bcx; - } - - case (ast.stmt_be(?e)) { - bcx = trans_be(cx, e).bcx; - } - case (ast.stmt_expr(?e)) { bcx = trans_expr(cx, e).bcx; } |