summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-24 04:38:10 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-24 04:38:10 +0000
commitf61858b1164eab2afd67c3814b79d50a386a92c0 (patch)
tree32c889c6af8c94b35fa34616d0f0ec559826922c /parse.y
parent6a3c97169c8a671f5feda7eba2b2a7529252daf3 (diff)
thread->thred
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y23
1 files changed, 16 insertions, 7 deletions
diff --git a/parse.y b/parse.y
index de14f4f6ea..2ae06640fe 100644
--- a/parse.y
+++ b/parse.y
@@ -180,7 +180,7 @@ static void top_local_setup();
%type <node> f_arglist f_args f_optarg f_opt f_block_arg opt_f_block_arg
%type <node> array assoc_list assocs assoc undef_list
%type <node> iter_var opt_iter_var iter_block iter_do_block
-%type <node> mlhs mlhs_head mlhs_tail lhs backref
+%type <node> mlhs mlhs_head mlhs_tail mlhs_basic mlhs_item lhs backref
%type <id> variable symbol operation
%type <id> cname fname op f_rest_arg
%type <num> f_arg
@@ -433,13 +433,21 @@ command_call : operation call_args
fixpos($$, $2);
}
-mlhs : mlhs_head
+mlhs : mlhs_basic
+ | tLPAREN mlhs_item ')'
{
- $$ = NEW_MASGN(NEW_LIST($1), 0);
+ $$ = $2;
}
- | tLPAREN mlhs ')'
+
+mlhs_item : mlhs_basic
+ | tLPAREN mlhs_item ')'
{
- $$ = $2;
+ $$ = NEW_MASGN(NEW_LIST($2), 0);
+ }
+
+mlhs_basic : mlhs_head
+ {
+ $$ = NEW_MASGN(NEW_LIST($1), 0);
}
| mlhs_head tSTAR lhs
{
@@ -459,7 +467,7 @@ mlhs : mlhs_head
}
mlhs_head : lhs ','
- | tLPAREN mlhs ')' ','
+ | tLPAREN mlhs_item ')' ','
{
$$ = $2;
}
@@ -468,7 +476,7 @@ mlhs_tail : lhs
{
$$ = NEW_LIST($1);
}
- | tLPAREN mlhs ')'
+ | tLPAREN mlhs_item ')'
{
$$ = NEW_LIST($2);
}
@@ -853,6 +861,7 @@ mrhs : args
}
| args ',' tSTAR arg
{
+ value_expr($4);
$$ = arg_add($1, $4);
}
| tSTAR arg