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:
parent
681754c29d
commit
4c5d7d53b2
2 changed files with 9 additions and 0 deletions
|
@ -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).
|
||||
|
|
4
parse.y
4
parse.y
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue