From c46bdadb84bec5fd4484e4375e2935d740984618 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 5 Mar 2012 16:34:21 +0000 Subject: * parse.y (block_call): rules for block_call after block_call. based on a patch by pasberth https://github.com/ruby/ruby/pull/102 [ruby-dev:45308][Bug #6115] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'parse.y') diff --git a/parse.y b/parse.y index f81819c9e5..4796e7453c 100644 --- a/parse.y +++ b/parse.y @@ -3856,6 +3856,30 @@ block_call : command do_block $$ = method_optarg($$, $4); %*/ } + | block_call dot_or_colon operation2 opt_paren_args brace_block + { + /*%%%*/ + block_dup_check($4, $5); + $5->nd_iter = NEW_CALL($1, $3, $4); + $$ = $5; + fixpos($$, $1); + /*% + $$ = dispatch4(command_call, $1, $2, $3, $4); + $$ = method_add_block($$, $5); + %*/ + } + | block_call dot_or_colon operation2 command_args do_block + { + /*%%%*/ + block_dup_check($4, $5); + $5->nd_iter = NEW_CALL($1, $3, $4); + $$ = $5; + fixpos($$, $1); + /*% + $$ = dispatch4(command_call, $1, $2, $3, $4); + $$ = method_add_block($$, $5); + %*/ + } ; method_call : operation -- cgit v1.2.3