summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-28 02:27:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-28 02:27:06 +0000
commita1096ba77cc2da7bb04f8948faad994a7d171363 (patch)
tree06e9555470d74cfaebb9fe0b69397fd7d66f4cd4 /parse.y
parented5208d851e5cfc846a4b9c70c466b0bdb0a8cc5 (diff)
* parse.y (new_yield): remove magic argument rule; "yield [1,2]"
should yield single array of two elements, not two values. [ruby-dev:21726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y17
1 files changed, 1 insertions, 16 deletions
diff --git a/parse.y b/parse.y
index 3f738e2..7901bca 100644
--- a/parse.y
+++ b/parse.y
@@ -5377,22 +5377,7 @@ static NODE *
new_yield(node)
NODE *node;
{
- long state = Qtrue;
-
- if (node) {
- no_blockarg(node);
- if (nd_type(node) == NODE_ARRAY && node->nd_next == 0) {
- node = node->nd_head;
- state = Qfalse;
- }
- if (nd_type(node) == NODE_SPLAT) {
- state = Qtrue;
- }
- }
- else {
- state = Qfalse;
- }
- return NEW_YIELD(node, state);
+ return NEW_YIELD(node, node ? Qtrue : Qfalse);
}
static NODE*