ruby-changes:5680
From: shyouhei <ko1@a...>
Date: Sun, 15 Jun 2008 19:47:03 +0900 (JST)
Subject: [ruby-changes:5680] Ruby:r17186 (ruby_1_8_6): merge revision(s) 15541,15545,15558:
shyouhei 2008-06-15 19:46:45 +0900 (Sun, 15 Jun 2008) New Revision: 17186 Modified files: branches/ruby_1_8_6/ChangeLog branches/ruby_1_8_6/parse.y branches/ruby_1_8_6/test/ruby/test_beginendblock.rb branches/ruby_1_8_6/version.h Log: merge revision(s) 15541,15545,15558: * parse.y (yycompile): clear ruby_eval_tree_begin too before parse. * parse.y (yycompile): clear ruby_eval_tree_begin if parse failed. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ChangeLog?r1=17186&r2=17185&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=17186&r2=17185&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/test/ruby/test_beginendblock.rb?r1=17186&r2=17185&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/parse.y?r1=17186&r2=17185&diff_format=u Index: ruby_1_8_6/parse.y =================================================================== --- ruby_1_8_6/parse.y (revision 17185) +++ ruby_1_8_6/parse.y (revision 17186) @@ -2619,6 +2619,7 @@ ruby__end__seen = 0; ruby_eval_tree = 0; + ruby_eval_tree_begin = 0; heredoc_end = 0; lex_strterm = 0; ruby_current_node = 0; @@ -2644,7 +2645,7 @@ rb_gc_force_recycle((VALUE)tmp); } if (n == 0) node = ruby_eval_tree; - else ruby_eval_tree_begin = 0; + if (ruby_nerrs) ruby_eval_tree_begin = 0; return node; } Index: ruby_1_8_6/ChangeLog =================================================================== --- ruby_1_8_6/ChangeLog (revision 17185) +++ ruby_1_8_6/ChangeLog (revision 17186) @@ -1,3 +1,11 @@ +Sun Jun 15 19:44:52 2008 Nobuyoshi Nakada <nobu@r...> + + * parse.y (yycompile): clear ruby_eval_tree_begin if parse failed. + +Sun Jun 15 19:44:52 2008 Nobuyoshi Nakada <nobu@r...> + + * parse.y (yycompile): clear ruby_eval_tree_begin too before parse. + Sun Jun 15 19:22:21 2008 Nobuyoshi Nakada <nobu@r...> * ext/pty/lib/expect.rb (IO#expect): check if peer is closed. Index: ruby_1_8_6/version.h =================================================================== --- ruby_1_8_6/version.h (revision 17185) +++ ruby_1_8_6/version.h (revision 17186) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2008-06-15" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20080615 -#define RUBY_PATCHLEVEL 180 +#define RUBY_PATCHLEVEL 181 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 Index: ruby_1_8_6/test/ruby/test_beginendblock.rb =================================================================== --- ruby_1_8_6/test/ruby/test_beginendblock.rb (revision 17185) +++ ruby_1_8_6/test/ruby/test_beginendblock.rb (revision 17186) @@ -83,4 +83,16 @@ assert_nil $?.exitstatus assert_equal Signal.list["INT"], $?.termsig end + + def test_begin_and_eval + $test_begin_and_eval = :ok + begin + eval("BEGIN{$test_begin_and_eval = :ng}\n_/a:a") + rescue SyntaxError + x1 = x2 = $test_begin_and_eval + eval("x2 = $test_begin_and_eval") + end + assert_equal(:ok, x1) + assert_equal(:ok, x2) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/