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

* parse.y (reduce_nodes_gen): preserve NODE_FL_NEWLINE flag during

node reducing.  [ruby-core:24463]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2009-08-20 14:42:16 +00:00
parent 681754c29d
commit 4c5d7d53b2
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Thu Aug 20 23:39:51 2009 Yusuke Endoh <mame@tsg.ne.jp>
* parse.y (reduce_nodes_gen): preserve NODE_FL_NEWLINE flag during
node reducing. [ruby-core:24463]
Thu Aug 20 14:39:47 2009 NARUSE, Yui <naruse@ruby-lang.org>
* ext/readline/readline.c (readline_get): add rl_prep_terminal(1).

View file

@ -8406,6 +8406,7 @@ reduce_nodes_gen(struct parser_params *parser, NODE **body)
(reduce_nodes(&node->n1), body = &node->n2, 1))
while (node) {
int newline = node->flags & NODE_FL_NEWLINE;
switch (nd_type(node)) {
end:
case NODE_NIL:
@ -8413,9 +8414,11 @@ reduce_nodes_gen(struct parser_params *parser, NODE **body)
return;
case NODE_RETURN:
*body = node = node->nd_stts;
if (newline && node) node->flags |= NODE_FL_NEWLINE;
continue;
case NODE_BEGIN:
*body = node = node->nd_body;
if (newline && node) node->flags |= NODE_FL_NEWLINE;
continue;
case NODE_BLOCK:
body = &node->nd_end->nd_head;
@ -8439,6 +8442,7 @@ reduce_nodes_gen(struct parser_params *parser, NODE **body)
return;
}
node = *body;
if (newline && node) node->flags |= NODE_FL_NEWLINE;
}
#undef subnodes