Skip to content

Commit b2c93b3

Browse files
committed
merge revision(s) 14045, 14059:
* parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814] * parse.y (newline_node): set line from outermost node before removing NODE_BEGIN. [ruby-dev:32406] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@16960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 01dabde commit b2c93b3

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Sun Jun 8 04:46:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
2+
3+
* parse.y (newline_node): set line from outermost node before removing
4+
NODE_BEGIN. [ruby-dev:32406]
5+
6+
Sun Jun 8 04:37:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
7+
8+
* parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]
9+
110
Sun Jun 8 04:18:50 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
211

312
* object.c (nil_plus): remove unused function. [ruby-core:13737]

parse.y

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ stmts : none
406406
}
407407
| error stmt
408408
{
409-
$$ = $2;
409+
$$ = remove_begin($2);
410410
}
411411
;
412412

@@ -436,7 +436,7 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
436436
}
437437
| stmt kIF_MOD expr_value
438438
{
439-
$$ = NEW_IF(cond($3), $1, 0);
439+
$$ = NEW_IF(cond($3), remove_begin($1), 0);
440440
fixpos($$, $3);
441441
if (cond_negative(&$$->nd_cond)) {
442442
$$->nd_else = $$->nd_body;
@@ -445,7 +445,7 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
445445
}
446446
| stmt kUNLESS_MOD expr_value
447447
{
448-
$$ = NEW_UNLESS(cond($3), $1, 0);
448+
$$ = NEW_UNLESS(cond($3), remove_begin($1), 0);
449449
fixpos($$, $3);
450450
if (cond_negative(&$$->nd_cond)) {
451451
$$->nd_body = $$->nd_else;
@@ -478,7 +478,8 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
478478
}
479479
| stmt kRESCUE_MOD stmt
480480
{
481-
$$ = NEW_RESCUE($1, NEW_RESBODY(0,$3,0), 0);
481+
NODE *resq = NEW_RESBODY(0, remove_begin($3), 0);
482+
$$ = NEW_RESCUE(remove_begin($1), resq, 0);
482483
}
483484
| klBEGIN
484485
{
@@ -4555,10 +4556,13 @@ newline_node(node)
45554556
{
45564557
NODE *nl = 0;
45574558
if (node) {
4559+
int line;
45584560
if (nd_type(node) == NODE_NEWLINE) return node;
4559-
nl = NEW_NEWLINE(node);
4560-
fixpos(nl, node);
4561-
nl->nd_nth = nd_line(node);
4561+
line = nd_line(node);
4562+
node = remove_begin(node);
4563+
nl = NEW_NEWLINE(node);
4564+
nd_set_line(nl, line);
4565+
nl->nd_nth = line;
45624566
}
45634567
return nl;
45644568
}
@@ -5213,7 +5217,7 @@ void_stmts(node)
52135217

52145218
for (;;) {
52155219
if (!node->nd_next) return;
5216-
void_expr(node->nd_head);
5220+
void_expr0(node->nd_head);
52175221
node = node->nd_next;
52185222
}
52195223
}

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RUBY_RELEASE_DATE "2008-06-08"
33
#define RUBY_VERSION_CODE 185
44
#define RUBY_RELEASE_CODE 20080608
5-
#define RUBY_PATCHLEVEL 151
5+
#define RUBY_PATCHLEVEL 153
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8

0 commit comments

Comments
 (0)