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

ruby-changes:32819

From: nagachika <ko1@a...>
Date: Mon, 10 Feb 2014 00:36:45 +0900 (JST)
Subject: [ruby-changes:32819] nagachika:r44898 (ruby_2_0_0): merge revision(s) r44449: [Backport #9308]

nagachika	2014-02-10 00:36:38 +0900 (Mon, 10 Feb 2014)

  New Revision: 44898

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

  Log:
    merge revision(s) r44449: [Backport #9308]
    
    * parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
      isolate command argument state from outer scope.
      [ruby-core:59342] [Bug #9308]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/parse.y
    branches/ruby_2_0_0/test/ruby/test_syntax.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 44897)
+++ ruby_2_0_0/ChangeLog	(revision 44898)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Mon Feb 10 00:27:33 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
+	  isolate command argument state from outer scope.
+	  [ruby-core:59342] [Bug #9308]
+
 Mon Feb 10 00:02:18 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* dir.c (glob_helper): don't skip current directories if FNM_DOTMATCH
Index: ruby_2_0_0/parse.y
===================================================================
--- ruby_2_0_0/parse.y	(revision 44897)
+++ ruby_2_0_0/parse.y	(revision 44898)
@@ -132,6 +132,7 @@ struct local_vars { https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/parse.y#L132
     struct vtable *vars;
     struct vtable *used;
     struct local_vars *prev;
+    stack_type cmdargs;
 };
 
 #define DVARS_INHERIT ((void*)1)
@@ -9492,6 +9493,8 @@ local_push_gen(struct parser_params *par https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/parse.y#L9493
     local->used = !(inherit_dvars &&
 		    (ifndef_ripper(compile_for_eval || e_option_supplied(parser))+0)) &&
 	RTEST(ruby_verbose) ? vtable_alloc(0) : 0;
+    local->cmdargs = cmdarg_stack;
+    cmdarg_stack = 0;
     lvtbl = local;
 }
 
@@ -9505,6 +9508,7 @@ local_pop_gen(struct parser_params *pars https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/parse.y#L9508
     }
     vtable_free(lvtbl->args);
     vtable_free(lvtbl->vars);
+    cmdarg_stack = lvtbl->cmdargs;
     xfree(lvtbl);
     lvtbl = local;
 }
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 44897)
+++ ruby_2_0_0/version.h	(revision 44898)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2014-02-10"
-#define RUBY_PATCHLEVEL 397
+#define RUBY_PATCHLEVEL 398
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 2
Index: ruby_2_0_0/test/ruby/test_syntax.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_syntax.rb	(revision 44897)
+++ ruby_2_0_0/test/ruby/test_syntax.rb	(revision 44898)
@@ -235,6 +235,11 @@ class TestSyntax < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_syntax.rb#L235
     assert_valid_syntax("p begin 1.times do 1 end end", __FILE__, bug6419)
   end
 
+  def test_do_block_in_call_args
+    bug9308 = '[ruby-core:59342] [Bug #9308]'
+    assert_valid_syntax("bar def foo; self.each do end end", bug9308)
+  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_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r44449


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

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