diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 10:46:45 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 10:46:45 +0000 |
commit | 9de707ad302fd045fb01b1f5d3680c3fc65b95dd (patch) | |
tree | c07d1749bb3397e4d1ce7057c072678fd9458f35 | |
parent | 823be2d795e2435cc5aa9b35c787fb5ac87d02ac (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-- | ChangeLog | 8 | ||||
-rw-r--r-- | parse.y | 3 | ||||
-rw-r--r-- | test/ruby/test_beginendblock.rb | 12 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 23 insertions, 2 deletions
@@ -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. @@ -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 @@ -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 |