From f0221db4626bb589f230bf239a7f9df83d7e444f Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 28 Jun 2002 14:42:46 +0000 Subject: * re.c (rb_reg_expr_str): need to process backslashes properly. * object.c (rb_any_to_a): declare Object#to_a to be obsolete. * object.c (rb_Array): do not convert nil into [] automagically. * object.c (rb_Integer): use "to_int" instead of "to_i". [experimental] * object.c (nil_to_f): new method. * object.c (rb_Integer): Symbols and nil should cause error. * object.c (rb_Float): nil should cause error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 6ebeb201b8..287a497b8d 100644 --- a/parse.y +++ b/parse.y @@ -233,7 +233,7 @@ static void top_local_setup(); %type words qwords word_list qword_list word %type literal numeric %type bodystmt compstmt stmts stmt expr arg primary command command_call method_call -%type expr_value arg_value primary_value block_call_value +%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 when_args call_args call_args2 open_args paren_args opt_paren_args %type command_args aref_args opt_block_arg block_arg var_ref var_lhs @@ -605,11 +605,11 @@ command_call : command ; block_command : block_call - | block_call_value '.' operation2 command_args + | block_call '.' operation2 command_args { $$ = new_call($1, $3, $4); } - | block_call_value tCOLON2 operation2 command_args + | block_call tCOLON2 operation2 command_args { $$ = new_call($1, $3, $4); } @@ -1075,6 +1075,7 @@ arg_value : arg aref_args : none | command opt_nl { + rb_warn("parenthesize argument(s) for future version"); $$ = NEW_LIST($1); } | args trailer @@ -1107,10 +1108,12 @@ paren_args : '(' none ')' } | '(' block_call opt_nl ')' { + rb_warn("parenthesize argument for future version"); $$ = NEW_LIST($2); } | '(' args ',' block_call opt_nl ')' { + rb_warn("parenthesize argument for future version"); $$ = list_append($2, $4); } ; @@ -1121,6 +1124,7 @@ opt_paren_args : none call_args : command { + rb_warn("parenthesize argument(s) for future version"); $$ = NEW_LIST($1); } | args opt_block_arg @@ -1623,23 +1627,16 @@ block_call : command do_block $$ = $2; fixpos($$, $2); } - | block_call_value '.' operation2 opt_paren_args + | block_call '.' operation2 opt_paren_args { $$ = new_call($1, $3, $4); } - | block_call_value tCOLON2 operation2 opt_paren_args + | block_call tCOLON2 operation2 opt_paren_args { $$ = new_call($1, $3, $4); } ; -block_call_value : block_call - { - value_expr($$); - $$ = $1; - } - ; - method_call : operation paren_args { $$ = new_fcall($1, $2); -- cgit v1.2.3