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

ruby-changes:19470

From: yugui <ko1@a...>
Date: Thu, 12 May 2011 06:26:03 +0900 (JST)
Subject: [ruby-changes:19470] Ruby:r31509 (ruby_1_9_2): merges r30799 from trunk into ruby_1_9_2.

yugui	2011-05-12 06:23:20 +0900 (Thu, 12 May 2011)

  New Revision: 31509

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

  Log:
    merges r30799 from trunk into ruby_1_9_2.
    --
    * parse.y (mlhs_basic): include mlhs_post for ripper.  a patch
      from Michael Edgar at [ruby-core:35078].

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

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 31508)
+++ ruby_1_9_2/ChangeLog	(revision 31509)
@@ -1,3 +1,8 @@
+Sat Feb  5 21:47:09 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (mlhs_basic): include mlhs_post for ripper.  a patch
+	  from Michael Edgar at [ruby-core:35078].
+
 Sat Feb  5 11:29:10 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/json/parser/parser.h (GET_PARSER): raise TypeError.
Index: ruby_1_9_2/parse.y
===================================================================
--- ruby_1_9_2/parse.y	(revision 31508)
+++ ruby_1_9_2/parse.y	(revision 31509)
@@ -1507,7 +1507,8 @@
 		    /*%%%*/
 			$$ = NEW_MASGN($1, NEW_POSTARG(-1, $4));
 		    /*%
-			$$ = mlhs_add_star($1, Qnil);
+			$1 = mlhs_add_star($1, Qnil);
+			$$ = mlhs_add($1, $4);
 		    %*/
 		    }
 		| tSTAR mlhs_node
@@ -1523,7 +1524,8 @@
 		    /*%%%*/
 			$$ = NEW_MASGN(0, NEW_POSTARG($2,$4));
 		    /*%
-			$$ = mlhs_add_star(mlhs_new(), $2);
+			$2 = mlhs_add_star(mlhs_new(), $2);
+			$$ = mlhs_add($2, $4);
 		    %*/
 		    }
 		| tSTAR
@@ -1540,6 +1542,7 @@
 			$$ = NEW_MASGN(0, NEW_POSTARG(-1, $3));
 		    /*%
 			$$ = mlhs_add_star(mlhs_new(), Qnil);
+			$$ = mlhs_add($$, $3);
 		    %*/
 		    }
 		;
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 31508)
+++ ruby_1_9_2/version.h	(revision 31509)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 193
+#define RUBY_PATCHLEVEL 194
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_2/test/ripper/test_parser_events.rb
===================================================================
--- ruby_1_9_2/test/ripper/test_parser_events.rb	(revision 31508)
+++ ruby_1_9_2/test/ripper/test_parser_events.rb	(revision 31509)
@@ -368,6 +368,7 @@
 
   def test_mlhs_add_star
     bug2232 = '[ruby-core:26163]'
+    bug4364 = '[ruby-core:35078]'
 
     thru_mlhs_add_star = false
     tree = parse("a, *b = 1, 2", :on_mlhs_add_star) {thru_mlhs_add_star = true}
@@ -377,6 +378,18 @@
     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)
+    thru_mlhs_add_star = false
+    tree = parse("a, *, 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\)\),mlhs_add\(mlhs_new\(\),c\)\)/, tree, bug4364)
+    thru_mlhs_add_star = false
+    tree = parse("*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_new\(\),b\),mlhs_add\(mlhs_new\(\),c\)\)/, tree, bug4364)
+    thru_mlhs_add_star = false
+    tree = parse("*, 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_new\(\)\),mlhs_add\(mlhs_new\(\),c\)\)/, tree, bug4364)
   end
 
   def test_mlhs_new

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

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