diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-11 04:20:27 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-11 04:20:27 +0000 |
commit | aa473577fe647eda0cc044dc1e854d269a4c63d2 (patch) | |
tree | f5de2cca6712e8db666d71b4a3973ef8faa78471 /parse.y | |
parent | 6670aee9793b2fb57ecfe0c89111bc08bed79d14 (diff) |
merges r28123 from trunk into ruby_1_9_2.
--
* compile.c (iseq_compile_each): should consider block on stack,
if block argument is passed. [ruby-core:30534]
* parse.c (arg_concat_gen): should append to nd_head, not to
nd_iter for NODE_BLOCK_PASS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1953,7 +1953,12 @@ arg : lhs '=' arg value_expr($6); if (!$3) $3 = NEW_ZARRAY(); - args = arg_concat($3, $6); + if (nd_type($3) == NODE_BLOCK_PASS) { + args = NEW_ARGSCAT($3, $6); + } + else { + args = arg_concat($3, $6); + } if ($5 == tOROP) { $5 = 0; } @@ -8313,7 +8318,10 @@ arg_concat_gen(struct parser_params *parser, NODE *node1, NODE *node2) if (!node2) return node1; switch (nd_type(node1)) { case NODE_BLOCK_PASS: - node1->nd_iter = arg_concat(node1->nd_iter, node2); + if (node1->nd_head) + node1->nd_head = arg_concat(node1->nd_head, node2); + else + node1->nd_head = NEW_LIST(node2); return node1; case NODE_ARGSPUSH: if (nd_type(node2) != NODE_ARRAY) break; |