summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-10 02:38:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-10 02:38:29 +0000
commitea16ec561fb022a204b876be4e3dfb0e08afac58 (patch)
treefedddb098445d195283726df35a44ed2d7d3e2e3
parent5cbf827a2ed551991236298bc9896fcc3f02abb6 (diff)
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
-rw-r--r--parse.y17
1 files changed, 6 insertions, 11 deletions
diff --git a/parse.y b/parse.y
index d6645c5f4f..df07940d76 100644
--- a/parse.y
+++ b/parse.y
@@ -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
{
/*%%%*/