diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 16:21:26 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 16:21:26 +0000 |
commit | 41fee53fa410a7a479df31630b6ca96757d10048 (patch) | |
tree | cad83550fa44551fda19c457352c4d4c6565a211 /parse.y | |
parent | 1d3067eb61c590629c22968fc0c56181f9dbc23d (diff) | |
download | ruby-41fee53fa410a7a479df31630b6ca96757d10048.tar.gz |
parse.y: Remove double meaning of new_op_assign, etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 51 |
1 files changed, 31 insertions, 20 deletions
@@ -475,11 +475,6 @@ static VALUE new_qcall(struct parser_params *p, VALUE q, VALUE r, VALUE m, VALUE static VALUE new_command_qcall(struct parser_params* p, VALUE atype, VALUE recv, VALUE mid, VALUE args, VALUE block, const YYLTYPE *op_loc, const YYLTYPE *loc); #define new_nil(loc) Qnil -#define new_op_assign(p,lhs,op,rhs,loc) dispatch3(opassign, (lhs), (op), (rhs)) - -static VALUE new_ary_op_assign(struct parser_params *p, VALUE ary, VALUE args, VALUE op, VALUE rhs, const YYLTYPE *args_loc, const YYLTYPE *loc); -static VALUE new_attr_op_assign(struct parser_params *p, VALUE lhs, VALUE type, VALUE attr, VALUE op, VALUE rhs, const YYLTYPE *loc); -#define new_const_op_assign(p, lhs, op, rhs, loc) new_op_assign(p, lhs, op, rhs, loc) static VALUE new_regexp(struct parser_params *, VALUE, VALUE, const YYLTYPE *); @@ -1209,23 +1204,36 @@ command_asgn : lhs '=' command_rhs } | var_lhs tOP_ASGN command_rhs { + /*%%%*/ value_expr($3); $$ = new_op_assign(p, $1, $2, $3, &@$); + /*% %*/ + /*% ripper: opassign!($1, $2, $3) %*/ } | primary_value '[' opt_call_args rbracket tOP_ASGN command_rhs { + /*%%%*/ value_expr($6); $$ = new_ary_op_assign(p, $1, $3, $5, $6, &@3, &@$); + /*% %*/ + /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $6) %*/ + } | primary_value call_op tIDENTIFIER tOP_ASGN command_rhs { + /*%%%*/ value_expr($5); $$ = new_attr_op_assign(p, $1, $2, $3, $4, $5, &@$); + /*% %*/ + /*% ripper: opassign!(field!($1, $2, $3), $4, $5) %*/ } | primary_value call_op tCONSTANT tOP_ASGN command_rhs { + /*%%%*/ value_expr($5); $$ = new_attr_op_assign(p, $1, $2, $3, $4, $5, &@$); + /*% %*/ + /*% ripper: opassign!(field!($1, $2, $3), $4, $5) %*/ } | primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs { @@ -1237,8 +1245,11 @@ command_asgn : lhs '=' command_rhs } | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs { + /*%%%*/ value_expr($5); $$ = new_attr_op_assign(p, $1, ID2VAL(idCOLON2), $3, $4, $5, &@$); + /*% %*/ + /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $5) %*/ } | backref tOP_ASGN command_rhs { @@ -1806,27 +1817,42 @@ arg : lhs '=' arg_rhs } | var_lhs tOP_ASGN arg_rhs { + /*%%%*/ $$ = new_op_assign(p, $1, $2, $3, &@$); + /*% %*/ + /*% ripper: opassign!($1, $2, $3) %*/ } | primary_value '[' opt_call_args rbracket tOP_ASGN arg_rhs { + /*%%%*/ value_expr($6); $$ = new_ary_op_assign(p, $1, $3, $5, $6, &@3, &@$); + /*% %*/ + /*% ripper: opassign!(aref_field!($1, escape_Qundef($3)), $5, $6) %*/ } | primary_value call_op tIDENTIFIER tOP_ASGN arg_rhs { + /*%%%*/ value_expr($5); $$ = new_attr_op_assign(p, $1, $2, $3, $4, $5, &@$); + /*% %*/ + /*% ripper: opassign!(field!($1, $2, $3), $4, $5) %*/ } | primary_value call_op tCONSTANT tOP_ASGN arg_rhs { + /*%%%*/ value_expr($5); $$ = new_attr_op_assign(p, $1, $2, $3, $4, $5, &@$); + /*% %*/ + /*% ripper: opassign!(field!($1, $2, $3), $4, $5) %*/ } | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs { + /*%%%*/ value_expr($5); $$ = new_attr_op_assign(p, $1, ID2VAL(idCOLON2), $3, $4, $5, &@$); + /*% %*/ + /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $5) %*/ } | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs { @@ -10019,21 +10045,6 @@ const_decl(struct parser_params *p, NODE *path, const YYLTYPE *loc) } #else static VALUE -new_ary_op_assign(struct parser_params *p, VALUE ary, - VALUE args, VALUE op, VALUE rhs, const YYLTYPE *args_loc, const YYLTYPE *loc) -{ - VALUE recv = dispatch2(aref_field, ary, escape_Qundef(args)); - return dispatch3(opassign, recv, op, rhs); -} - -static VALUE -new_attr_op_assign(struct parser_params *p, VALUE lhs, VALUE type, VALUE attr, VALUE op, VALUE rhs, const YYLTYPE *loc) -{ - VALUE recv = dispatch3(field, lhs, type, attr); - return dispatch3(opassign, recv, op, rhs); -} - -static VALUE new_qcall(struct parser_params *p, VALUE q, VALUE r, VALUE m, VALUE a, YYLTYPE *op_loc, const YYLTYPE *loc) { VALUE ret = dispatch3(call, (r), (q), (m)); |