syntax: Rename expr_alt to expr_match

This commit is contained in:
Brian Anderson
2012-08-07 13:35:51 -07:00
parent 92ef17aaeb
commit bc267c696c
19 changed files with 25 additions and 25 deletions

View File

@@ -177,7 +177,7 @@ impl public_methods for borrowck_ctxt {
ast::expr_vstore(*) | ast::expr_vec(*) | ast::expr_tup(*) |
ast::expr_if(*) | ast::expr_log(*) |
ast::expr_binary(*) | ast::expr_while(*) |
ast::expr_block(*) | ast::expr_loop(*) | ast::expr_alt(*) |
ast::expr_block(*) | ast::expr_loop(*) | ast::expr_match(*) |
ast::expr_lit(*) | ast::expr_break | ast::expr_mac(*) |
ast::expr_again | ast::expr_rec(*) | ast::expr_struct(*) |
ast::expr_unary_move(*) | ast::expr_repeat(*) => {

View File

@@ -171,7 +171,7 @@ fn req_loans_in_expr(ex: @ast::expr,
visit::visit_expr(ex, self, vt);
}
ast::expr_alt(ex_v, arms, _) => {
ast::expr_match(ex_v, arms, _) => {
let cmt = self.bccx.cat_expr(ex_v);
for arms.each |arm| {
for arm.pats.each |pat| {

View File

@@ -23,7 +23,7 @@ fn check_crate(tcx: ty::ctxt, crate: @crate) {
fn check_expr(tcx: ty::ctxt, ex: @expr, &&s: (), v: visit::vt<()>) {
visit::visit_expr(ex, s, v);
match ex.node {
expr_alt(scrut, arms, mode) => {
expr_match(scrut, arms, mode) => {
check_arms(tcx, arms);
/* Check for exhaustiveness */
// Check for empty enum, because is_useful only works on inhabited

View File

@@ -453,7 +453,7 @@ fn visit_expr(expr: @expr, &&self: @ir_maps, vt: vt<@ir_maps>) {
}
// live nodes required for interesting control flow:
expr_if(*) | expr_alt(*) | expr_while(*) | expr_loop(*) => {
expr_if(*) | expr_match(*) | expr_while(*) | expr_loop(*) => {
(*self).add_live_node_for_node(expr.id, lnk_expr(expr.span));
visit::visit_expr(expr, self, vt);
}
@@ -966,7 +966,7 @@ class liveness {
self.propagate_through_loop(expr, none, blk, succ)
}
expr_alt(e, arms, _) => {
expr_match(e, arms, _) => {
//
// (e)
// |
@@ -1449,7 +1449,7 @@ fn check_expr(expr: @expr, &&self: @liveness, vt: vt<@liveness>) {
}
// no correctness conditions related to liveness
expr_if(*) | expr_alt(*) |
expr_if(*) | expr_match(*) |
expr_while(*) | expr_loop(*) |
expr_index(*) | expr_field(*) | expr_vstore(*) |
expr_vec(*) | expr_rec(*) | expr_tup(*) |

View File

@@ -237,7 +237,7 @@ fn resolve_expr(expr: @ast::expr, cx: ctxt, visitor: visit::vt<ctxt>) {
debug!{"node %d: %s", expr.id, pprust::expr_to_str(expr)};
new_cx.parent = some(expr.id);
}
ast::expr_alt(subexpr, _, _) => {
ast::expr_match(subexpr, _, _) => {
debug!{"node %d: %s", expr.id, pprust::expr_to_str(expr)};
new_cx.parent = some(expr.id);
}

View File

@@ -3665,7 +3665,7 @@ fn trans_expr(bcx: block, e: @ast::expr, dest: dest) -> block {
ast::expr_if(cond, thn, els) => {
return trans_if(bcx, cond, thn, els, dest);
}
ast::expr_alt(expr, arms, mode) => {
ast::expr_match(expr, arms, mode) => {
return alt::trans_alt(bcx, e, expr, arms, mode, dest);
}
ast::expr_block(blk) => {

View File

@@ -243,7 +243,7 @@ fn mark_for_expr(cx: ctx, e: @expr) {
}
})
}
expr_alt(_, _, _) | expr_block(_) | expr_if(_, _, _) |
expr_match(_, _, _) | expr_block(_) | expr_if(_, _, _) |
expr_while(_, _) | expr_fail(_) | expr_break | expr_again |
expr_unary(_, _) | expr_lit(_) | expr_assert(_) |
expr_mac(_) | expr_addr_of(_, _) |

View File

@@ -388,7 +388,7 @@ fn find_pre_post_expr(fcx: fn_ctxt, e: @expr) {
loop_postcond);
}
expr_index(val, sub) { find_pre_post_exprs(fcx, ~[val, sub], e.id); }
expr_alt(ex, alts, _) {
expr_match(ex, alts, _) {
find_pre_post_expr(fcx, ex);
fn do_an_alt(fcx: fn_ctxt, an_alt: arm) -> pre_and_post {
match an_alt.guard {

View File

@@ -443,7 +443,7 @@ fn find_pre_post_state_expr(fcx: fn_ctxt, pres: prestate, e: @expr) -> bool {
expr_index(val, sub) {
return find_pre_post_state_two(fcx, pres, val, sub, e.id, oper_pure);
}
expr_alt(val, alts, _) {
expr_match(val, alts, _) {
let mut changed =
set_prestate_ann(fcx.ccx, e.id, pres) |
find_pre_post_state_expr(fcx, pres, val);

View File

@@ -1472,7 +1472,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
fcx.write_ty(id, ty::mk_nil(tcx));
bot = !may_break(body);
}
ast::expr_alt(discrim, arms, _) => {
ast::expr_match(discrim, arms, _) => {
bot = alt::check_alt(fcx, expr, discrim, arms);
}
ast::expr_fn(proto, decl, body, cap_clause) => {

View File

@@ -34,7 +34,7 @@ fn explain_region(cx: ctxt, region: ty::region) -> ~str {
some(ast_map::node_expr(expr)) => {
match expr.node {
ast::expr_call(*) => { explain_span(cx, ~"call", expr.span) }
ast::expr_alt(*) => { explain_span(cx, ~"alt", expr.span) }
ast::expr_match(*) => { explain_span(cx, ~"alt", expr.span) }
_ => { explain_span(cx, ~"expression", expr.span) }
}
}
@@ -106,7 +106,7 @@ fn re_scope_id_to_str(cx: ctxt, node_id: ast::node_id) -> ~str {
fmt!{"<call at %s>",
codemap::span_to_str(expr.span, cx.sess.codemap)}
}
ast::expr_alt(*) => {
ast::expr_match(*) => {
fmt!{"<alt at %s>",
codemap::span_to_str(expr.span, cx.sess.codemap)}
}