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

ruby-changes:37199

From: naruse <ko1@a...>
Date: Fri, 16 Jan 2015 17:36:18 +0900 (JST)
Subject: [ruby-changes:37199] naruse:r49280 (ruby_2_2): merge revision(s) 49140: [Backport #10693]

naruse	2015-01-16 17:35:53 +0900 (Fri, 16 Jan 2015)

  New Revision: 49280

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

  Log:
    merge revision(s) 49140: [Backport #10693]
    
    * parse.y (f_label): return tLABEL value as it is.
      [ruby-core:67315] [Bug #10693]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/parse.y
    branches/ruby_2_2/test/ripper/test_parser_events.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 49279)
+++ ruby_2_2/ChangeLog	(revision 49280)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Fri Jan 16 17:34:57 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (f_label): return tLABEL value as it is.
+	  [ruby-core:67315] [Bug #10693]
+
 Fri Jan 16 16:49:04 2015  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* lib/net/http.rb (Net::HTTP#send_request): there is no response body
Index: ruby_2_2/parse.y
===================================================================
--- ruby_2_2/parse.y	(revision 49279)
+++ ruby_2_2/parse.y	(revision 49280)
@@ -4720,9 +4720,9 @@ f_arg		: f_arg_item https://github.com/ruby/ruby/blob/trunk/ruby_2_2/parse.y#L4720
 f_label 	: tLABEL
 		    {
 			ID id = get_id($1);
-			$$ = formal_argument(id);
-			arg_var($$);
+			arg_var(formal_argument(id));
 			current_arg = id;
+			$$ = $1;
 		    }
 		;
 
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 49279)
+++ ruby_2_2/version.h	(revision 49280)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.0"
 #define RUBY_RELEASE_DATE "2015-01-16"
-#define RUBY_PATCHLEVEL 12
+#define RUBY_PATCHLEVEL 13
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 1
Index: ruby_2_2/test/ripper/test_parser_events.rb
===================================================================
--- ruby_2_2/test/ripper/test_parser_events.rb	(revision 49279)
+++ ruby_2_2/test/ripper/test_parser_events.rb	(revision 49280)
@@ -751,15 +751,31 @@ class TestRipper::ParserEvents < Test::U https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ripper/test_parser_events.rb#L751
   end
 
   def test_params
+    arg = nil
     thru_params = false
-    parse('a {||}', :on_params) {thru_params = true}
+    parse('a {||}', :on_params) {|_, *v| thru_params = true; arg = v}
     assert_equal true, thru_params
+    assert_equal [nil, nil, nil, nil, nil, nil, nil], arg
     thru_params = false
-    parse('a {|x|}', :on_params) {thru_params = true}
+    parse('a {|x|}', :on_params) {|_, *v| thru_params = true; arg = v}
     assert_equal true, thru_params
+    assert_equal [["x"], nil, nil, nil, nil, nil, nil], arg
     thru_params = false
-    parse('a {|*x|}', :on_params) {thru_params = true}
+    parse('a {|*x|}', :on_params) {|_, *v| thru_params = true; arg = v}
     assert_equal true, thru_params
+    assert_equal [nil, nil, "*x", nil, nil, nil, nil], arg
+    thru_params = false
+    parse('a {|x: 1|}', :on_params) {|_, *v| thru_params = true; arg = v}
+    assert_equal true, thru_params
+    assert_equal [nil, nil, nil, nil, [["x:", "1"]], nil, nil], arg
+    thru_params = false
+    parse('a {|x:|}', :on_params) {|_, *v| thru_params = true; arg = v}
+    assert_equal true, thru_params
+    assert_equal [nil, nil, nil, nil, [["x:", false]], nil, nil], arg
+    thru_params = false
+    parse('a {|**x|}', :on_params) {|_, *v| thru_params = true; arg = v}
+    assert_equal true, thru_params
+    assert_equal [nil, nil, nil, nil, nil, "x", nil], arg
   end
 
   def test_paren

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r49140


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

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