1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

parse.y: mrhs_arg

* parse.y (mrhs_arg): reduce duplicated code.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-04-10 02:38:29 +00:00
parent 5cbf827a2e
commit ea16ec561f

17
parse.y
View file

@ -767,7 +767,7 @@ static void token_info_pop(struct parser_params*, const char *token);
%type <node> args call_args opt_call_args
%type <node> paren_args opt_paren_args args_tail opt_args_tail block_args_tail opt_block_args_tail
%type <node> command_args aref_args opt_block_arg block_arg var_ref var_lhs
%type <node> command_asgn mrhs superclass block_call block_command
%type <node> command_asgn mrhs mrhs_arg superclass block_call block_command
%type <node> f_block_optarg f_block_opt
%type <node> f_arglist f_args f_arg f_arg_item f_optarg f_marg f_marg_list f_margs
%type <node> assoc_list assocs assoc undef_list backref string_dvar for_var
@ -1238,16 +1238,7 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
$$ = dispatch2(assign, $1, $3);
%*/
}
| mlhs '=' arg_value
{
/*%%%*/
$1->nd_value = $3;
$$ = $1;
/*%
$$ = dispatch2(massign, $1, $3);
%*/
}
| mlhs '=' mrhs
| mlhs '=' mrhs_arg
{
/*%%%*/
$1->nd_value = $3;
@ -2528,6 +2519,10 @@ args : arg_value
}
;
mrhs_arg : mrhs
| arg_value
;
mrhs : args ',' arg_value
{
/*%%%*/