e$B$J$+$@$G$9!#e(B
e$B$3$N7Y9p$Oe(B1.8.0e$B$N$H$-$+$i:#$N7A$G=P$F$$$^$9$7!"$=$m$=$m%a%=%C%Ie(B
e$BL>$H%+%C%3$N4V$K$O%9%Z!<%9$OCV$1$J$/$7$F$b$$$$$s$8$c$J$$$G$7$g$&e(B
e$B$+!#e(B
Index: parse.y
— parse.y (revision 15639)
+++ parse.y (working copy)
@@ -663,6 +663,6 @@ static void ripper_compile_error(struct
%type expr_value arg_value primary_value
%type if_tail opt_else case_body cases opt_rescue exc_list
exc_var opt_ensure
-%type args call_args call_args2 opt_call_args
-%type open_args paren_args opt_paren_args
+%type args call_args opt_call_args
+%type paren_args opt_paren_args
%type command_args aref_args opt_block_arg block_arg var_ref
var_lhs
%type mrhs superclass block_call block_command
@@ -2326,58 +2326,9 @@ call_args : command
;
-call_args2 : arg_value ‘,’ args opt_block_arg
-
{
-
/*%%%*/
-
$$ = arg_blk_pass(list_concat(NEW_LIST($1),$3), $4);
-
/*%
-
$$ = arg_add_optblock(arg_prepend($3, $1), $4);
-
%*/
-
}
- | arg_value ‘,’ block_arg
-
{
-
/*%%%*/
-
$$ = arg_blk_pass(NEW_LIST($1), $3);
-
/*%
-
$$ = arg_add_block(arg_add(arg_new(), $1), $3);
-
%*/
-
}
- | assocs opt_block_arg
-
{
-
/*%%%*/
-
$$ = NEW_LIST(NEW_HASH($1));
-
$$ = arg_blk_pass($$, $2);
-
/*%
-
$$ = arg_add_assocs(arg_new(), $1);
-
$$ = arg_add_optblock($$, $2);
-
%*/
-
}
- | arg_value ‘,’ assocs opt_block_arg
-
{
-
/*%%%*/
-
$$ = arg_append(NEW_LIST($1), NEW_HASH($3));
-
$$ = arg_blk_pass($$, $4);
-
/*%
-
$$ = arg_add_assocs(arg_add(arg_new(), $1), $3);
-
$$ = arg_add_optblock($$, $4);
-
%*/
-
}
- | arg_value ‘,’ args ‘,’ assocs opt_block_arg
-
{
-
/*%%%*/
-
$$ = arg_append(list_concat(NEW_LIST($1),$3), NEW_HASH($5));
-
$$ = arg_blk_pass($$, $6);
-
/*%
-
$$ = arg_add_assocs(arg_prepend($3, $1), $5);
-
$$ = arg_add_optblock($$, $6);
-
%*/
-
}
- | block_arg
- ;
command_args : {
$$ = cmdarg_stack;
CMDARG_PUSH(1);
}
-
open_args
-
call_args { /* CMDARG_POP() */
@@ -2387,25 +2338,4 @@ command_args : {
;
-open_args : call_args
- | tLPAREN_ARG {lex_state = EXPR_ENDARG;} rparen
-
{
-
/*%%%*/
-
rb_warning0("don't put space before argument parentheses");
-
$$ = 0;
-
/*%
-
$$ = dispatch1(space, dispatch1(arg_paren, arg_new()));
-
%*/
-
}
- | tLPAREN_ARG call_args2 {lex_state = EXPR_ENDARG;} rparen
-
{
-
/*%%%*/
-
rb_warning0("don't put space before argument parentheses");
-
$$ = $2;
-
/*%
-
$$ = dispatch1(space, dispatch1(arg_paren, $2));
-
%*/
-
}
- ;
block_arg : tAMPER arg_value
{
@@ -6868,11 +6798,7 @@ parser_yylex(struct parser_params *parse
}
else if (space_seen) {
-
if (lex_state == EXPR_CMDARG) {
-
c = tLPAREN_ARG;if (IS_ARG()) {
}
-
else if (lex_state == EXPR_ARG) {
- rb_warning0(“don’t put space before argument parentheses”);
- c = ‘(’;
-
}}
paren_nest++;