From 1bf3fe1d60ab6cfe02686a032d9f76a0293c0999 Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 15 Jan 2009 16:33:06 +0000 Subject: merges r21571 from trunk into ruby_1_9_1. * ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script. * compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script) * parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 92d2a6217f..03daaf5c6f 100644 --- a/ruby.c +++ b/ruby.c @@ -1319,10 +1319,10 @@ process_options(VALUE arg) } #define PREPARE_PARSE_MAIN(expr) do { \ - th->parse_in_eval++; \ + th->parse_in_eval--; \ th->base_block = &env->block; \ expr; \ - th->parse_in_eval--; \ + th->parse_in_eval++; \ th->base_block = 0; \ } while (0) -- cgit v1.2.3