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

ruby-changes:13858

From: naruse <ko1@a...>
Date: Thu, 5 Nov 2009 12:11:41 +0900 (JST)
Subject: [ruby-changes:13858] Ruby:r25658 (ruby_1_8): * parse.y (args): use splat_array.

naruse	2009-11-05 12:11:27 +0900 (Thu, 05 Nov 2009)

  New Revision: 25658

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

  Log:
    * parse.y (args): use splat_array.
      fix: when *foo doesn't splat. [ruby-list:46517]

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/parse.y
    branches/ruby_1_8/test/ruby/test_case.rb

Index: ruby_1_8/parse.y
===================================================================
--- ruby_1_8/parse.y	(revision 25657)
+++ ruby_1_8/parse.y	(revision 25658)
@@ -1455,7 +1455,7 @@
 		| tSTAR arg_value
 		    {
 		    /*%%%*/
-			$$ = NEW_TO_ARY($2);
+			$$ = splat_array($2);
 		    /*%
 			$$ = arg_add_star(arg_new(), $2);
 		    %*/
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 25657)
+++ ruby_1_8/ChangeLog	(revision 25658)
@@ -1,3 +1,8 @@
+Thu Nov  5 12:06:35 2009  NARUSE, Yui  <naruse@r...>
+
+	* parse.y (args): use splat_array.
+	  fix: when *foo doesn't splat. [ruby-list:46517]
+
 Thu Nov  5 11:31:23 2009  NAKAMURA Usaku  <usa@r...>
 
 	* win32/win32.c (CreateChild): allocate temporary buffer and use it
Index: ruby_1_8/test/ruby/test_case.rb
===================================================================
--- ruby_1_8/test/ruby/test_case.rb	(revision 25657)
+++ ruby_1_8/test/ruby/test_case.rb	(revision 25658)
@@ -45,5 +45,12 @@
     else
       assert(false)
     end
+
+    case "+"
+    when *%w/. +/
+      assert(true)
+    else
+      assert(false)
+    end
   end
 end

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

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