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

ruby-changes:33007

From: naruse <ko1@a...>
Date: Sat, 22 Feb 2014 00:42:14 +0900 (JST)
Subject: [ruby-changes:33007] naruse:r45086 (ruby_2_1): merge revision(s) 44449: [Backport #9416]

naruse	2014-02-22 00:42:08 +0900 (Sat, 22 Feb 2014)

  New Revision: 45086

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

  Log:
    merge revision(s) 44449: [Backport #9416]
    
    * 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_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 45085)
+++ ruby_2_1/ChangeLog	(revision 45086)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Sat Feb 22 00:21:50 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]
+
 Fri Feb 21 23:51:38 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* encoding.c (must_encindex, rb_enc_from_index, rb_obj_encoding): mask
Index: ruby_2_1/parse.y
===================================================================
--- ruby_2_1/parse.y	(revision 45085)
+++ ruby_2_1/parse.y	(revision 45086)
@@ -130,6 +130,7 @@ struct local_vars { https://github.com/ruby/ruby/blob/trunk/ruby_2_1/parse.y#L130
     struct vtable *vars;
     struct vtable *used;
     struct local_vars *prev;
+    stack_type cmdargs;
 };
 
 #define DVARS_INHERIT ((void*)1)
@@ -9642,6 +9643,8 @@ local_push_gen(struct parser_params *par https://github.com/ruby/ruby/blob/trunk/ruby_2_1/parse.y#L9643
     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;
 }
 
@@ -9655,6 +9658,7 @@ local_pop_gen(struct parser_params *pars https://github.com/ruby/ruby/blob/trunk/ruby_2_1/parse.y#L9658
     }
     vtable_free(lvtbl->args);
     vtable_free(lvtbl->vars);
+    cmdarg_stack = lvtbl->cmdargs;
     xfree(lvtbl);
     lvtbl = local;
 }
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 45085)
+++ ruby_2_1/version.h	(revision 45086)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.1"
 #define RUBY_RELEASE_DATE "2014-02-22"
-#define RUBY_PATCHLEVEL 48
+#define RUBY_PATCHLEVEL 49
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 2
Index: ruby_2_1/test/ruby/test_syntax.rb
===================================================================
--- ruby_2_1/test/ruby/test_syntax.rb	(revision 45085)
+++ ruby_2_1/test/ruby/test_syntax.rb	(revision 45086)
@@ -256,6 +256,11 @@ WARN https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_syntax.rb#L256
     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_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r44449


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

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