1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-11-29 07:59:12 +00:00
parent 0cf0b82418
commit 058ec52c0d
3 changed files with 15 additions and 10 deletions

View file

@ -1,3 +1,7 @@
Thu Nov 29 16:59:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]
Wed Nov 28 18:08:00 2007 NARUSE, Yui <naruse@ruby-lang.org>
* ext/json, lib/json, test/json: Update to JSON 1.1.2.

15
parse.y
View file

@ -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;
}
}

View file

@ -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[];