Simplify AST for expr_anon_obj.

This commit is contained in:
Lindsey Kuper 2011-07-06 11:29:22 -07:00
parent 23bae67f4c
commit e30d2c82ae
10 changed files with 13 additions and 15 deletions

View file

@ -6268,7 +6268,7 @@ fn trans_expr_out(&@block_ctxt cx, &@ast::expr e, out_method output) ->
case (ast::expr_spawn(?dom, ?name, ?func, ?args)) {
ret trans_spawn(cx, dom, name, func, args, e.id);
}
case (ast::expr_anon_obj(?anon_obj, ?tps, _)) {
case (ast::expr_anon_obj(?anon_obj, ?tps)) {
ret trans_anon_obj(cx, e.span, anon_obj, tps, e.id);
}
case (_) {

View file

@ -571,7 +571,7 @@ fn find_pre_post_expr(&fn_ctxt fcx, @expr e) {
find_pre_post_expr(fcx, expanded);
copy_pre_post(fcx.ccx, e.id, expanded);
}
case (expr_anon_obj(?anon_obj, _, _)) {
case (expr_anon_obj(?anon_obj, _)) {
alt (anon_obj.with_obj) {
case (some(?ex)) {
find_pre_post_expr(fcx, ex);

View file

@ -570,7 +570,7 @@ fn find_pre_post_state_expr(&fn_ctxt fcx, &prestate pres, @expr e) -> bool {
case (expr_cont) { ret pure_exp(fcx.ccx, e.id, pres); }
case (expr_port(_)) { ret pure_exp(fcx.ccx, e.id, pres); }
case (expr_self_method(_)) { ret pure_exp(fcx.ccx, e.id, pres); }
case (expr_anon_obj(?anon_obj, _, _)) {
case (expr_anon_obj(?anon_obj, _)) {
alt (anon_obj.with_obj) {
case (some(?wt)) {
ret find_pre_post_state_sub(fcx, pres, wt, e.id, none);

View file

@ -2202,7 +2202,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
}
}
}
case (ast::expr_anon_obj(?anon_obj, ?tps, ?obj_def_ids)) {
case (ast::expr_anon_obj(?anon_obj, ?tps)) {
// TODO: We probably need to do more work here to be able to
// handle additional methods that use 'self'
@ -2221,12 +2221,11 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
ret rec(mut=f.mut, ty=f.ty, ident=f.ident, id=f.id);
}
let ast::node_id di = obj_def_ids.ty;
vec::push[obj_info](fcx.ccx.obj_infos,
rec(obj_fields=
vec::map(anon_obj_field_to_obj_field,
fields),
this_obj=di));
this_obj=id));
// FIXME: These next three functions are largely ripped off from
// similar ones in collect::. Is there a better way to do this?