ruby-changes:11876
From: yugui <ko1@a...>
Date: Fri, 22 May 2009 18:49:46 +0900 (JST)
Subject: [ruby-changes:11876] Ruby:r23535 (ruby_1_9_1): merges r23474 from trunk into ruby_1_9_1.
yugui 2009-05-22 18:49:28 +0900 (Fri, 22 May 2009) New Revision: 23535 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23535 Log: merges r23474 from trunk into ruby_1_9_1. -- * compile.c (rb_parse_in_eval): returns true in true eval, not in main. [ruby-dev:38382] * parse.y (program): inherits dvars in eval or main. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/compile.c branches/ruby_1_9_1/parse.y branches/ruby_1_9_1/version.h Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 23534) +++ ruby_1_9_1/ChangeLog (revision 23535) @@ -1,3 +1,10 @@ +Sun May 17 14:23:08 2009 Nobuyoshi Nakada <nobu@r...> + + * compile.c (rb_parse_in_eval): returns true in true eval, not in + main. [ruby-dev:38382] + + * parse.y (program): inherits dvars in eval or main. + Sun May 17 13:15:32 2009 Nobuyoshi Nakada <nobu@r...> * vm.c (rb_vm_get_sourceline): should not access out of bound. Index: ruby_1_9_1/compile.c =================================================================== --- ruby_1_9_1/compile.c (revision 23534) +++ ruby_1_9_1/compile.c (revision 23535) @@ -5413,7 +5413,7 @@ int rb_parse_in_eval(void) { - return GET_THREAD()->parse_in_eval != 0; + return GET_THREAD()->parse_in_eval > 0; } int Index: ruby_1_9_1/parse.y =================================================================== --- ruby_1_9_1/parse.y (revision 23534) +++ ruby_1_9_1/parse.y (revision 23535) @@ -765,14 +765,15 @@ program : { lex_state = EXPR_BEG; /*%%%*/ - local_push(compile_for_eval); + $<num>$ = compile_for_eval || rb_parse_in_main(); + local_push($<num>$); /*% %*/ } top_compstmt { /*%%%*/ - if ($2 && !compile_for_eval) { + if ($2 && !$<num>1) { /* last expression should not be void */ if (nd_type($2) != NODE_BLOCK) void_expr($2); else { @@ -5024,7 +5025,7 @@ NODE *tree; struct parser_params *parser = (struct parser_params *)arg; - if ((!compile_for_eval || rb_parse_in_main()) && rb_safe_level() == 0) { + if (!compile_for_eval && rb_safe_level() == 0) { ruby_debug_lines = debug_lines(ruby_sourcefile); if (ruby_debug_lines && ruby_sourceline > 0) { VALUE str = STR_NEW0(); Index: ruby_1_9_1/version.h =================================================================== --- ruby_1_9_1/version.h (revision 23534) +++ ruby_1_9_1/version.h (revision 23535) @@ -1,6 +1,6 @@ #define RUBY_VERSION "1.9.1" #define RUBY_RELEASE_DATE "2009-05-12" -#define RUBY_PATCHLEVEL 149 +#define RUBY_PATCHLEVEL 150 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/