diff --git a/ChangeLog b/ChangeLog index 67ec30f4c7..409daa97db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Nov 29 16:59:10 2007 Nobuyoshi Nakada + + * parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814] + Wed Nov 28 18:08:00 2007 NARUSE, Yui * ext/json, lib/json, test/json: Update to JSON 1.1.2. diff --git a/parse.y b/parse.y index 86f628c500..38d7d6da49 100644 --- a/parse.y +++ b/parse.y @@ -345,7 +345,8 @@ static int value_expr_gen(struct parser_params*,NODE*); static void void_expr_gen(struct parser_params*,NODE*); static NODE *remove_begin(NODE*); #define value_expr(node) value_expr_gen(parser, (node) = remove_begin(node)) -#define void_expr(node) void_expr_gen(parser, (node) = remove_begin(node)) +#define void_expr0(node) void_expr_gen(parser, (node)) +#define void_expr(node) void_expr0((node) = remove_begin(node)) static void void_stmts_gen(struct parser_params*,NODE*); #define void_stmts(node) void_stmts_gen(parser, node) static void reduce_nodes_gen(struct parser_params*,NODE**); @@ -798,10 +799,9 @@ compstmt : stmts opt_terms { /*%%%*/ void_stmts($1); - $$ = $1; /*% - $$ = $1; %*/ + $$ = $1; } ; @@ -884,7 +884,7 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem | stmt modifier_if expr_value { /*%%%*/ - $$ = NEW_IF(cond($3), $1, 0); + $$ = NEW_IF(cond($3), remove_begin($1), 0); fixpos($$, $3); if (cond_negative(&$$->nd_cond)) { $$->nd_else = $$->nd_body; @@ -897,7 +897,7 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem | stmt modifier_unless expr_value { /*%%%*/ - $$ = NEW_UNLESS(cond($3), $1, 0); + $$ = NEW_UNLESS(cond($3), remove_begin($1), 0); fixpos($$, $3); if (cond_negative(&$$->nd_cond)) { $$->nd_body = $$->nd_else; @@ -942,7 +942,8 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem | stmt modifier_rescue stmt { /*%%%*/ - $$ = NEW_RESCUE($1, NEW_RESBODY(0,$3,0), 0); + NODE *resq = NEW_RESBODY(0, remove_begin($3), 0); + $$ = NEW_RESCUE(remove_begin($1), resq, 0); /*% $$ = dispatch2(rescue_mod, $3, $1); %*/ @@ -7943,7 +7944,7 @@ void_stmts_gen(struct parser_params *parser, NODE *node) for (;;) { if (!node->nd_next) return; - void_expr(node->nd_head); + void_expr0(node->nd_head); node = node->nd_next; } } diff --git a/version.h b/version.h index 2203ed2640..cea5b8f13c 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2007-11-28" +#define RUBY_RELEASE_DATE "2007-11-29" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20071128 +#define RUBY_RELEASE_CODE 20071129 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 11 -#define RUBY_RELEASE_DAY 28 +#define RUBY_RELEASE_DAY 29 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[];