summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-05 16:34:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-05 16:34:21 +0000
commitc46bdadb84bec5fd4484e4375e2935d740984618 (patch)
treee2293bd39003a28ae4ce9fcee1fa9b6de9896e82 /parse.y
parent45f3651d1c0fbc286a3083eb03624fc9bc696232 (diff)
* 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
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y24
1 files changed, 24 insertions, 0 deletions
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