mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (call_args2, open_args): removed.
* parse.y (parser_yylex): unified warnings at space between method name and argument parenthese. [ruby-dev:33943] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a2b83212d6
commit
d2c3d9dd0b
2 changed files with 11 additions and 78 deletions
|
@ -1,3 +1,10 @@
|
|||
Sat Jun 21 16:29:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (call_args2, open_args): removed.
|
||||
|
||||
* parse.y (parser_yylex): unified warnings at space between method
|
||||
name and argument parenthese. [ruby-dev:33943]
|
||||
|
||||
Sat Jun 21 16:21:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* numeric.c (flo_round): get rid of overflow.
|
||||
|
|
82
parse.y
82
parse.y
|
@ -662,8 +662,8 @@ static void ripper_compile_error(struct parser_params*, const char *fmt, ...);
|
|||
%type <node> bodystmt compstmt stmts stmt expr arg primary command command_call method_call
|
||||
%type <node> expr_value arg_value primary_value
|
||||
%type <node> if_tail opt_else case_body cases opt_rescue exc_list exc_var opt_ensure
|
||||
%type <node> args call_args call_args2 opt_call_args
|
||||
%type <node> open_args paren_args opt_paren_args
|
||||
%type <node> args call_args opt_call_args
|
||||
%type <node> paren_args opt_paren_args
|
||||
%type <node> command_args aref_args opt_block_arg block_arg var_ref var_lhs
|
||||
%type <node> mrhs superclass block_call block_command
|
||||
%type <node> f_arglist f_args f_arg f_arg_item f_optarg f_marg f_marg_list f_margs
|
||||
|
@ -2358,60 +2358,11 @@ 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 : {
|
||||
$<num>$ = cmdarg_stack;
|
||||
CMDARG_PUSH(1);
|
||||
}
|
||||
open_args
|
||||
call_args
|
||||
{
|
||||
/* CMDARG_POP() */
|
||||
cmdarg_stack = $<num>1;
|
||||
|
@ -2419,27 +2370,6 @@ 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
|
||||
{
|
||||
/*%%%*/
|
||||
|
@ -6897,13 +6827,9 @@ parser_yylex(struct parser_params *parser)
|
|||
c = tLPAREN;
|
||||
}
|
||||
else if (space_seen) {
|
||||
if (lex_state == EXPR_CMDARG) {
|
||||
if (IS_ARG()) {
|
||||
c = tLPAREN_ARG;
|
||||
}
|
||||
else if (lex_state == EXPR_ARG) {
|
||||
rb_warning0("don't put space before argument parentheses");
|
||||
c = '(';
|
||||
}
|
||||
}
|
||||
paren_nest++;
|
||||
COND_PUSH(0);
|
||||
|
|
Loading…
Reference in a new issue