diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-06 13:19:31 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-06 13:19:31 +0000 |
commit | fd8b2547054fffe8dd01631b50e917df47c5b637 (patch) | |
tree | 16ff4ad037a8596fa2cda34aa908f211b8aa4162 /parse.y | |
parent | 199f814f32e97b2fed528801c0ad2c84c1e5f8a6 (diff) |
node.h: remove NODE_PRIVATE_RECV
* compile.c (private_recv_p): check by node type, instead of a
magic number.
* node.h (NODE_PRIVATE_RECV), parse.y (attrset_gen): remove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -444,7 +444,6 @@ static NODE *aryset_gen(struct parser_params*,NODE*,NODE*); #define aryset(node1,node2) aryset_gen(parser, (node1), (node2)) static NODE *attrset_gen(struct parser_params*,NODE*,ID); #define attrset(node,id) attrset_gen(parser, (node), (id)) -static inline NODE *attr_receiver(NODE *recv); static void rb_backref_error_gen(struct parser_params*,NODE*); #define rb_backref_error(n) rb_backref_error_gen(parser,(n)) @@ -1206,7 +1205,7 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem else if ($5 == tANDOP) { $5 = 1; } - $$ = NEW_OP_ASGN1(attr_receiver($1), $5, args); + $$ = NEW_OP_ASGN1($1, $5, args); fixpos($$, $1); /*% $$ = dispatch2(aref_field, $1, escape_Qundef($3)); @@ -1998,7 +1997,7 @@ arg : lhs '=' arg else if ($5 == tANDOP) { $5 = 1; } - $$ = NEW_OP_ASGN1(attr_receiver($1), $5, args); + $$ = NEW_OP_ASGN1($1, $5, args); fixpos($$, $1); /*% $1 = dispatch2(aref_field, $1, escape_Qundef($3)); @@ -8825,7 +8824,6 @@ new_bv_gen(struct parser_params *parser, ID name) static NODE * aryset_gen(struct parser_params *parser, NODE *recv, NODE *idx) { - recv = attr_receiver(recv); return NEW_ATTRASGN(recv, tASET, idx); } @@ -8895,18 +8893,9 @@ rb_id_attrget(ID id) return attrsetname_to_attr(rb_id2str(id)); } -static inline NODE * -attr_receiver(NODE *recv) -{ - if (recv && nd_type(recv) == NODE_SELF) - recv = NODE_PRIVATE_RECV; - return recv; -} - static NODE * attrset_gen(struct parser_params *parser, NODE *recv, ID id) { - recv = attr_receiver(recv); return NEW_ATTRASGN(recv, rb_id_attrset(id), 0); } @@ -9650,7 +9639,6 @@ new_attr_op_assign_gen(struct parser_params *parser, NODE *lhs, ID attr, ID op, else if (op == tANDOP) { op = 1; } - lhs = attr_receiver(lhs); asgn = NEW_OP_ASGN2(lhs, attr, op, rhs); fixpos(asgn, lhs); return asgn; |