summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-17 06:17:11 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-17 06:17:11 +0000
commitd3ab1b9c274b9f0a40b3d71f087f5f8170ab2635 (patch)
tree274fa2914e1d8fe955bf8ca16a90522a699b47aa /parse.y
parent83d929edb640ab8b585f76c182f41a55da360686 (diff)
merges r20770 from trunk into ruby_1_9_1.
* parse.y (block_call): block should not be given to yield. [ruby-core:20583] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 189bcedfdc..92dd38fc48 100644
--- a/parse.y
+++ b/parse.y
@@ -3497,7 +3497,12 @@ do_block : keyword_do_block
block_call : command do_block
{
/*%%%*/
- block_dup_check($1->nd_args, $2);
+ if (nd_type($1) == NODE_YIELD) {
+ compile_error(PARSER_ARG "block given to yield");
+ }
+ else {
+ block_dup_check($1->nd_args, $2);
+ }
$2->nd_iter = $1;
$$ = $2;
fixpos($$, $1);