summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 10:29:38 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 10:29:38 +0000
commite86c91414055573dc914c83ab0725f43926f478f (patch)
tree4a693c412f1741fac43becf03e372d7d863711b4
parente9ebea251d5d6c20f15e06cd232dab2522c4d16f (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_5@17184 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 3e2f6e994b0..6e04d91ee49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun Jun 15 19:24:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (yycompile): clear ruby_eval_tree_begin if parse failed.
+
+Sun Jun 15 19:23:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (yycompile): clear ruby_eval_tree_begin too before parse.
+
Sun Jun 15 19:21:26 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 90d4505a6cc..765e5b6e78c 100644
--- a/parse.y
+++ b/parse.y
@@ -2624,6 +2624,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;
@@ -2649,7 +2650,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 b56b596a651..f8c9c846bdb 100644
--- a/test/ruby/test_beginendblock.rb
+++ b/test/ruby/test_beginendblock.rb
@@ -54,4 +54,16 @@ EOW
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
diff --git a/version.h b/version.h
index 870cc7bf277..3656451480d 100644
--- a/version.h
+++ b/version.h
@@ -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