[前][次][番号順一覧][スレッド一覧]

ruby-changes:22935

From: nobu <ko1@a...>
Date: Mon, 12 Mar 2012 14:57:11 +0900 (JST)
Subject: [ruby-changes:22935] nobu:r34984 (trunk): * node.h (NEW_YIELD), parse.y (new_yield_gen): array-values flags

nobu	2012-03-12 14:56:57 +0900 (Mon, 12 Mar 2012)

  New Revision: 34984

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34984

  Log:
    * node.h (NEW_YIELD), parse.y (new_yield_gen): array-values flags
      has been already obsolete.  patch by Thomas Enebo.
      [ruby-core:41929][Bug #5847]

  Modified files:
    trunk/ChangeLog
    trunk/node.h
    trunk/parse.y

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34983)
+++ ChangeLog	(revision 34984)
@@ -1,3 +1,9 @@
+Mon Mar 12 14:56:52 2012  Nobuyoshi Nakada  <nobu@r...>
+
+	* node.h (NEW_YIELD), parse.y (new_yield_gen): array-values flags
+	  has been already obsolete.  patch by Thomas Enebo.
+	  [ruby-core:41929][Bug #5847]
+
 Mon Mar 12 12:44:33 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* vm_method.c (Init_eval_method): copy basic methods to Exception.
Index: parse.y
===================================================================
--- parse.y	(revision 34983)
+++ parse.y	(revision 34984)
@@ -2745,7 +2745,7 @@
 		| keyword_yield '(' rparen
 		    {
 		    /*%%%*/
-			$$ = NEW_YIELD(0, Qfalse);
+			$$ = NEW_YIELD(0);
 		    /*%
 			$$ = dispatch1(yield, dispatch1(paren, arg_new()));
 		    %*/
@@ -2753,7 +2753,7 @@
 		| keyword_yield
 		    {
 		    /*%%%*/
-			$$ = NEW_YIELD(0, Qfalse);
+			$$ = NEW_YIELD(0);
 		    /*%
 			$$ = dispatch0(yield0);
 		    %*/
@@ -9634,18 +9634,9 @@
 static NODE *
 new_yield_gen(struct parser_params *parser, NODE *node)
 {
-    long state = Qtrue;
+    if (node) no_blockarg(parser, node);
 
-    if (node) {
-        no_blockarg(parser, node);
-	if (node && nd_type(node) == NODE_SPLAT) {
-	    state = Qtrue;
-	}
-    }
-    else {
-        state = Qfalse;
-    }
-    return NEW_YIELD(node, state);
+    return NEW_YIELD(node);
 }
 
 static NODE*
Index: node.h
===================================================================
--- node.h	(revision 34983)
+++ node.h	(revision 34984)
@@ -376,7 +376,7 @@
 #define NEW_RESBODY(a,ex,n) NEW_NODE(NODE_RESBODY,n,ex,a)
 #define NEW_ENSURE(b,en) NEW_NODE(NODE_ENSURE,b,0,en)
 #define NEW_RETURN(s) NEW_NODE(NODE_RETURN,s,0,0)
-#define NEW_YIELD(a,s) NEW_NODE(NODE_YIELD,a,0,s)
+#define NEW_YIELD(a) NEW_NODE(NODE_YIELD,a,0,0)
 #define NEW_LIST(a)  NEW_ARRAY(a)
 #define NEW_ARRAY(a) NEW_NODE(NODE_ARRAY,a,1,0)
 #define NEW_ZARRAY() NEW_NODE(NODE_ZARRAY,0,0,0)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]