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

ruby-changes:38406

From: nagachika <ko1@a...>
Date: Thu, 14 May 2015 01:00:46 +0900 (JST)
Subject: [ruby-changes:38406] nagachika:r50487 (ruby_2_2): merge revision(s) 50402: [Backport #11107]

nagachika	2015-05-14 01:00:26 +0900 (Thu, 14 May 2015)

  New Revision: 50487

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

  Log:
    merge revision(s) 50402: [Backport #11107]
    
    * parse.y (lambda): push and reset cmdarg_stack in lambda body.
      [ruby-core:69017] [Bug #11107]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/parse.y
    branches/ruby_2_2/test/ruby/test_syntax.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 50486)
+++ ruby_2_2/ChangeLog	(revision 50487)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Thu May 14 00:50:40 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (lambda): push and reset cmdarg_stack in lambda body.
+	  [ruby-core:69017] [Bug #11107]
+
 Thu May 14 00:39:29 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* dln.c (dln_load): check if a different libruby is loaded by the
Index: ruby_2_2/parse.y
===================================================================
--- ruby_2_2/parse.y	(revision 50486)
+++ ruby_2_2/parse.y	(revision 50487)
@@ -3534,14 +3534,19 @@ lambda		:   { https://github.com/ruby/ruby/blob/trunk/ruby_2_2/parse.y#L3534
 		    {
 			$<num>$ = ruby_sourceline;
 		    }
+		    {
+			$<val>$ = cmdarg_stack;
+			cmdarg_stack = 0;
+		    }
 		  lambda_body
 		    {
 			lpar_beg = $<num>2;
+			cmdarg_stack = $<val>5;
 		    /*%%%*/
-			$$ = NEW_LAMBDA($3, $5);
+			$$ = NEW_LAMBDA($3, $6);
 			nd_set_line($$, $<num>4);
 		    /*%
-			$$ = dispatch2(lambda, $3, $5);
+			$$ = dispatch2(lambda, $3, $6);
 		    %*/
 			dyna_pop($<vars>1);
 		    }
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 50486)
+++ ruby_2_2/version.h	(revision 50487)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.3"
 #define RUBY_RELEASE_DATE "2015-05-14"
-#define RUBY_PATCHLEVEL 100
+#define RUBY_PATCHLEVEL 101
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 5
Index: ruby_2_2/test/ruby/test_syntax.rb
===================================================================
--- ruby_2_2/test/ruby/test_syntax.rb	(revision 50486)
+++ ruby_2_2/test/ruby/test_syntax.rb	(revision 50487)
@@ -400,6 +400,11 @@ WARN https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_syntax.rb#L400
     assert_valid_syntax("bar def foo; self.each do end end", bug9308)
   end
 
+  def test_do_block_in_lambda
+    bug11107 = '[ruby-core:69017] [Bug #11107]'
+    assert_valid_syntax('p ->() do a() do end end', bug11107)
+  end
+
   def test_reserved_method_no_args
     bug6403 = '[ruby-dev:45626]'
     assert_valid_syntax("def self; :foo; end", __FILE__, bug6403)

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


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

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