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

ruby-changes:14192

From: yugui <ko1@a...>
Date: Sat, 5 Dec 2009 18:46:23 +0900 (JST)
Subject: [ruby-changes:14192] Ruby:r26012 (ruby_1_9_1): merges r25404 from trunk into ruby_1_9_1. fixes the backport task #2232.

yugui	2009-12-05 18:39:56 +0900 (Sat, 05 Dec 2009)

  New Revision: 26012

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

  Log:
    merges r25404 from trunk into ruby_1_9_1. fixes the backport task #2232.
    --
    * parse.y (mlhs_basic): fixed handling splat in middle of mlhs.  a
      patch from Andy Keep in [ruby-core:26163]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/parse.y
    branches/ruby_1_9_1/test/ripper/test_parser_events.rb
    branches/ruby_1_9_1/version.h

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 26011)
+++ ruby_1_9_1/ChangeLog	(revision 26012)
@@ -1,3 +1,7 @@
+Tue Oct 20 15:07:37 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (mlhs_basic): fixed handling splat in middle of mlhs.  a
+	  patch from Andy Keep in [ruby-core:26163]
 Thu Oct 15 16:57:38 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (rb_intern3): check symbol table overflow.
Index: ruby_1_9_1/parse.y
===================================================================
--- ruby_1_9_1/parse.y	(revision 26011)
+++ ruby_1_9_1/parse.y	(revision 26012)
@@ -1475,7 +1475,8 @@
 		    /*%%%*/
 			$$ = NEW_MASGN($1, NEW_POSTARG($3,$5));
 		    /*%
-			$$ = mlhs_add_star($1, $3);
+			$1 = mlhs_add_star($1, $3);
+			$$ = mlhs_add($1, $5);
 		    %*/
 		    }
 		| mlhs_head tSTAR
Index: ruby_1_9_1/version.h
===================================================================
--- ruby_1_9_1/version.h	(revision 26011)
+++ ruby_1_9_1/version.h	(revision 26012)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 365
+#define RUBY_PATCHLEVEL 366
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_1/test/ripper/test_parser_events.rb
===================================================================
--- ruby_1_9_1/test/ripper/test_parser_events.rb	(revision 26011)
+++ ruby_1_9_1/test/ripper/test_parser_events.rb	(revision 26012)
@@ -216,6 +216,46 @@
     assert_equal("heredoc1\nheredoc2\n", heredoc, bug1921)
   end
 
+  def test_massign
+    thru_massign = false
+    parse("a, b = 1, 2", :on_massign) {thru_massign = true}
+    assert_equal true, thru_massign
+  end
+
+  def test_mlhs_add
+    thru_mlhs_add = false
+    parse("a, b = 1, 2", :on_mlhs_add) {thru_mlhs_add = true}
+    assert_equal true, thru_mlhs_add
+  end
+
+  def test_mlhs_add_star
+    bug2232 = '[ruby-core:26163]'
+
+    thru_mlhs_add_star = false
+    tree = parse("a, *b = 1, 2", :on_mlhs_add_star) {thru_mlhs_add_star = true}
+    assert_equal true, thru_mlhs_add_star
+    assert_match /mlhs_add_star\(mlhs_add\(mlhs_new\(\),a\),b\)/, tree
+    thru_mlhs_add_star = false
+    tree = parse("a, *b, c = 1, 2", :on_mlhs_add_star) {thru_mlhs_add_star = true}
+    assert_equal true, thru_mlhs_add_star
+    assert_match /mlhs_add\(mlhs_add_star\(mlhs_add\(mlhs_new\(\),a\),b\),mlhs_add\(mlhs_new\(\),c\)\)/, tree, bug2232
+  end
+
+  def test_mlhs_new
+    thru_mlhs_new = false
+    parse("a, b = 1, 2", :on_mlhs_new) {thru_mlhs_new = true}
+    assert_equal true, thru_mlhs_new
+  end
+
+  def test_mlhs_paren
+    thru_mlhs_paren = false
+    parse("a, b = 1, 2", :on_mlhs_paren) {thru_mlhs_paren = true}
+    assert_equal false, thru_mlhs_paren
+    thru_mlhs_paren = false
+    parse("(a, b) = 1, 2", :on_mlhs_paren) {thru_mlhs_paren = true}
+    assert_equal true, thru_mlhs_paren
+  end
+
 =begin
   def test_brace_block
     assert_equal true, $thru__brace_block
@@ -333,30 +373,10 @@
     assert_equal true, $thru__iter_block
   end
 
-  def test_massign
-    assert_equal true, $thru__massign
-  end
-
   def test_method_add_arg
     assert_equal true, $thru__method_add_arg
   end
 
-  def test_mlhs_add
-    assert_equal true, $thru__mlhs_add
-  end
-
-  def test_mlhs_add_star
-    assert_equal true, $thru__mlhs_add_star
-  end
-
-  def test_mlhs_new
-    assert_equal true, $thru__mlhs_new
-  end
-
-  def test_mlhs_paren
-    assert_equal true, $thru__mlhs_paren
-  end
-
   def test_module
     assert_equal true, $thru__module
   end

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

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