diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | NEWS | 12 | ||||
-rw-r--r-- | parse.y | 10 |
3 files changed, 26 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Fri Sep 3 16:42:59 2010 Akinori MUSHA <[email protected]> + + * parse.y (method_call): Add support for Ruby 1.9 style method + invocation syntax f.(x) / f::(x), which is interpreted as + f.call(x). + Fri Sep 3 12:40:54 2010 Nobuyoshi Nakada <[email protected]> * intern.h (rb_usascii_str_new): macros for forward compatibility. @@ -17,8 +17,16 @@ with all sufficient information, see the ChangeLog file. * new hash immediates - Ruby 1.9 style hash syntax e.g. { key: value } is now also supported - in 1.8. You can also write a method invocation syntax foo bar: baz. + Ruby 1.9 style hash syntax e.g. { key: value } is now supported. + Just like the normal hash syntax, you can put key-value pairs + without enclosing parentheses at the end of a method argument list. + e.g. some_method foo: 1, bar: 2 + +* new method invocation syntax + + Ruby 1.9 style special method invocation syntax f.(x), which is + equivalent to f.call(x), is supported. This is mainly for use + in invoking a Proc. === Configuration changes @@ -1900,6 +1900,16 @@ method_call : operation paren_args { $$ = new_call($1, $3, 0); } + | primary_value '.' paren_args + { + $$ = new_call($1, rb_intern("call"), $3); + fixpos($$, $1); + } + | primary_value tCOLON2 paren_args + { + $$ = new_call($1, rb_intern("call"), $3); + fixpos($$, $1); + } | kSUPER paren_args { $$ = new_super($2); |