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

ruby-changes:5678

From: shyouhei <ko1@a...>
Date: Sun, 15 Jun 2008 19:29:50 +0900 (JST)
Subject: [ruby-changes:5678] Ruby:r17184 (ruby_1_8_5): merge revision(s) 15541, 15545, 15558:

shyouhei	2008-06-15 19:29:38 +0900 (Sun, 15 Jun 2008)

  New Revision: 17184

  Modified files:
    branches/ruby_1_8_5/ChangeLog
    branches/ruby_1_8_5/parse.y
    branches/ruby_1_8_5/test/ruby/test_beginendblock.rb
    branches/ruby_1_8_5/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_5/test/ruby/test_beginendblock.rb?r1=17184&r2=17183&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/version.h?r1=17184&r2=17183&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/parse.y?r1=17184&r2=17183&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/ChangeLog?r1=17184&r2=17183&diff_format=u

Index: ruby_1_8_5/parse.y
===================================================================
--- ruby_1_8_5/parse.y	(revision 17183)
+++ ruby_1_8_5/parse.y	(revision 17184)
@@ -2624,6 +2624,7 @@
 
     ruby__end__seen = 0;
     ruby_eval_tree = 0;
+    ruby_eval_tree_begin = 0;
     heredoc_end = 0;
     lex_strterm = 0;
     ruby_current_node = 0;
@@ -2649,7 +2650,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_5/ChangeLog
===================================================================
--- ruby_1_8_5/ChangeLog	(revision 17183)
+++ ruby_1_8_5/ChangeLog	(revision 17184)
@@ -1,3 +1,11 @@
+Sun Jun 15 19:24:42 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (yycompile): clear ruby_eval_tree_begin if parse failed.
+
+Sun Jun 15 19:23:23 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (yycompile): clear ruby_eval_tree_begin too before parse.
+
 Sun Jun 15 19:21:26 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/pty/lib/expect.rb (IO#expect): check if peer is closed.
Index: ruby_1_8_5/version.h
===================================================================
--- ruby_1_8_5/version.h	(revision 17183)
+++ ruby_1_8_5/version.h	(revision 17184)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2008-06-15"
 #define RUBY_VERSION_CODE 185
 #define RUBY_RELEASE_CODE 20080615
-#define RUBY_PATCHLEVEL 179
+#define RUBY_PATCHLEVEL 180
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
Index: ruby_1_8_5/test/ruby/test_beginendblock.rb
===================================================================
--- ruby_1_8_5/test/ruby/test_beginendblock.rb	(revision 17183)
+++ ruby_1_8_5/test/ruby/test_beginendblock.rb	(revision 17184)
@@ -54,4 +54,16 @@
     assert_equal(expected, File.read(erroutpath))
     # expecting Tempfile to unlink launcher and errout file.
   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/

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