From 1092bbfff0cf932ef14e5b92cd54133571ca4727 Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Thu, 7 Apr 2011 13:49:27 -0700 Subject: Support for self-calls that take arguments. Nicer parsing of self-calls (expr_self_method nodes inside expr_call nodes, rather than a separate expr_call_self) makes typechecking tractable. We can now write self-calls that take arguments and return values (see: test/run-pass/obj-self-*.rs). --- src/comp/middle/trans.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/comp/middle/trans.rs') diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index e1660b3f..5a8ce98b 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -3911,10 +3911,7 @@ fn trans_lval(@block_ctxt cx, @ast.expr e) -> lval_result { C_int(abi.box_rc_field_body))); ret lval_mem(sub.bcx, val); } - - // Kind of bizarre to pass an *entire* self-call here...but let's try - // it - case (ast.expr_call_self(?ident, _, ?ann)) { + case (ast.expr_self_method(?ident, ?ann)) { alt (cx.fcx.llself) { case (some[self_vt](?s_vt)) { auto r = s_vt.v; @@ -4765,11 +4762,6 @@ fn trans_expr(@block_ctxt cx, @ast.expr e) -> result { ret trans_call(cx, f, none[ValueRef], args, ann); } - case (ast.expr_call_self(?ident, ?args, ?ann)) { - // A weird hack to make self-calls work. - ret trans_call(cx, e, none[ValueRef], args, ann); - } - case (ast.expr_cast(?e, _, ?ann)) { ret trans_cast(cx, e, ann); } -- cgit v1.2.3