summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 10:46:45 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 10:46:45 +0000
commit9de707ad302fd045fb01b1f5d3680c3fc65b95dd (patch)
treec07d1749bb3397e4d1ce7057c072678fd9458f35
parent823be2d795e2435cc5aa9b35c787fb5ac87d02ac (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--parse.y3
-rw-r--r--test/ruby/test_beginendblock.rb12
-rw-r--r--version.h2
4 files changed, 23 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 03d18c5643..3c507f66ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun Jun 15 19:44:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (yycompile): clear ruby_eval_tree_begin if parse failed.
+
+Sun Jun 15 19:44:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (yycompile): clear ruby_eval_tree_begin too before parse.
+
Sun Jun 15 19:22:21 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/pty/lib/expect.rb (IO#expect): check if peer is closed.
diff --git a/parse.y b/parse.y
index 33db814826..3e0118f75c 100644
--- a/parse.y
+++ b/parse.y
@@ -2619,6 +2619,7 @@ yycompile(f, line)
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 @@ yycompile(f, line)
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;
}
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb
index a60e41b848..ae96eacad3 100644
--- a/test/ruby/test_beginendblock.rb
+++ b/test/ruby/test_beginendblock.rb
@@ -83,4 +83,16 @@ EOW
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
diff --git a/version.h b/version.h
index 853e9b4231..7bb516003f 100644
--- a/version.h
+++ b/version.h
@@ -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