ruby-changes:28161
From: nobu <ko1@a...>
Date: Wed, 10 Apr 2013 11:38:39 +0900 (JST)
Subject: [ruby-changes:28161] nobu:r40213 (trunk): parse.y: mrhs_arg
nobu 2013-04-10 11:38:29 +0900 (Wed, 10 Apr 2013) New Revision: 40213 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40213 Log: parse.y: mrhs_arg * parse.y (mrhs_arg): reduce duplicated code. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 40212) +++ parse.y (revision 40213) @@ -767,7 +767,7 @@ static void token_info_pop(struct parser https://github.com/ruby/ruby/blob/trunk/parse.y#L767 %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 = https://github.com/ruby/ruby/blob/trunk/parse.y#L1238 $$ = 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 https://github.com/ruby/ruby/blob/trunk/parse.y#L2519 } ; +mrhs_arg : mrhs + | arg_value + ; + mrhs : args ',' arg_value { /*%%%*/ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/