mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (stmt, arg, aref_args): should not make sole splat into
array, in aref_args other than aref with op_asgn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d834d3a763
commit
a6ed135520
2 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Apr 23 14:52:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (stmt, arg, aref_args): should not make sole splat into
|
||||
array, in aref_args other than aref with op_asgn.
|
||||
|
||||
Fri Apr 23 14:14:38 2004 Tanaka Akira <akr@m17n.org>
|
||||
|
||||
* lib/resolv.rb: don't use Regexp#source to embed regexps.
|
||||
|
|
8
parse.y
8
parse.y
|
@ -169,7 +169,7 @@ static void top_local_setup();
|
|||
|
||||
#define NODE_STRTERM NODE_ZARRAY /* nothing to gc */
|
||||
#define NODE_HEREDOC NODE_ARRAY /* 1, 3 to gc */
|
||||
#define SIGN_EXTEND(x,n) (((1<<(n))-1-((x)&~(~0<<(n))))^~(~0<<(n)))
|
||||
#define SIGN_EXTEND(x,n) (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1))
|
||||
#define nd_func u1.id
|
||||
#if SIZEOF_SHORT == 2
|
||||
#define nd_term(node) ((signed short)(node)->u2.id)
|
||||
|
@ -533,6 +533,8 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
|
|||
|
||||
value_expr($6);
|
||||
args = NEW_LIST($6);
|
||||
if ($3 && nd_type($3) != NODE_ARRAY)
|
||||
$3 = NEW_LIST($3);
|
||||
$3 = list_append($3, NEW_NIL());
|
||||
list_concat(args, $3);
|
||||
if ($5 == tOROP) {
|
||||
|
@ -995,6 +997,8 @@ arg : lhs '=' arg
|
|||
|
||||
value_expr($6);
|
||||
args = NEW_LIST($6);
|
||||
if ($3 && nd_type($3) != NODE_ARRAY)
|
||||
$3 = NEW_LIST($3);
|
||||
$3 = list_append($3, NEW_NIL());
|
||||
list_concat(args, $3);
|
||||
if ($5 == tOROP) {
|
||||
|
@ -1235,7 +1239,7 @@ aref_args : none
|
|||
| tSTAR arg opt_nl
|
||||
{
|
||||
value_expr($2);
|
||||
$$ = NEW_LIST(NEW_SPLAT($2));
|
||||
$$ = newline_node(NEW_SPLAT($2));
|
||||
}
|
||||
;
|
||||
|
||||
|
|
Loading…
Reference in a new issue