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

ruby-changes:38387

From: usa <ko1@a...>
Date: Mon, 11 May 2015 11:01:58 +0900 (JST)
Subject: [ruby-changes:38387] usa:r50468 (ruby_2_1): merge revision(s) 50402: [Backport #11107]

usa	2015-05-11 11:01:46 +0900 (Mon, 11 May 2015)

  New Revision: 50468

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

  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_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/parse.y
    branches/ruby_2_1/test/ruby/test_syntax.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 50467)
+++ ruby_2_1/ChangeLog	(revision 50468)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Mon May 11 10:59:53 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (lambda): push and reset cmdarg_stack in lambda body.
+	  [ruby-core:69017] [Bug #11107]
+
 Tue Apr 28 14:15:49 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/fileutils.rb (FileUtils#mv): show the exact target path in
Index: ruby_2_1/parse.y
===================================================================
--- ruby_2_1/parse.y	(revision 50467)
+++ ruby_2_1/parse.y	(revision 50468)
@@ -3467,14 +3467,19 @@ lambda		:   { https://github.com/ruby/ruby/blob/trunk/ruby_2_1/parse.y#L3467
 		    {
 			$<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_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 50467)
+++ ruby_2_1/version.h	(revision 50468)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.7"
-#define RUBY_RELEASE_DATE "2015-04-28"
-#define RUBY_PATCHLEVEL 340
+#define RUBY_RELEASE_DATE "2015-05-11"
+#define RUBY_PATCHLEVEL 341
 
 #define RUBY_RELEASE_YEAR 2015
-#define RUBY_RELEASE_MONTH 4
-#define RUBY_RELEASE_DAY 28
+#define RUBY_RELEASE_MONTH 5
+#define RUBY_RELEASE_DAY 11
 
 #include "ruby/version.h"
 
Index: ruby_2_1/test/ruby/test_syntax.rb
===================================================================
--- ruby_2_1/test/ruby/test_syntax.rb	(revision 50467)
+++ ruby_2_1/test/ruby/test_syntax.rb	(revision 50468)
@@ -266,6 +266,11 @@ WARN https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_syntax.rb#L266
     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_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r50402


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

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