diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-28 14:42:46 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-28 14:42:46 +0000 |
commit | f0221db4626bb589f230bf239a7f9df83d7e444f (patch) | |
tree | 0bd6a2a6dde695b2ac3cf1193419676a78f914b9 /parse.y | |
parent | ee852ed46d1a2a0f894e20e939b079c31e1cdb4b (diff) |
* 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
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -233,7 +233,7 @@ static void top_local_setup(); %type <node> words qwords word_list qword_list word %type <val> literal numeric %type <node> bodystmt compstmt stmts stmt expr arg primary command command_call method_call -%type <node> expr_value arg_value primary_value block_call_value +%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 when_args call_args call_args2 open_args paren_args opt_paren_args %type <node> 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); |