ruby-changes:12863
From: mame <ko1@a...>
Date: Thu, 20 Aug 2009 23:42:33 +0900 (JST)
Subject: [ruby-changes:12863] Ruby:r24595 (trunk): * parse.y (reduce_nodes_gen): preserve NODE_FL_NEWLINE flag during
mame 2009-08-20 23:42:16 +0900 (Thu, 20 Aug 2009) New Revision: 24595 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24595 Log: * parse.y (reduce_nodes_gen): preserve NODE_FL_NEWLINE flag during node reducing. [ruby-core:24463] Modified files: trunk/ChangeLog trunk/parse.y Index: ChangeLog =================================================================== --- ChangeLog (revision 24594) +++ ChangeLog (revision 24595) @@ -1,3 +1,8 @@ +Thu Aug 20 23:39:51 2009 Yusuke Endoh <mame@t...> + + * 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@r...> * ext/readline/readline.c (readline_get): add rl_prep_terminal(1). Index: parse.y =================================================================== --- parse.y (revision 24594) +++ parse.y (revision 24595) @@ -8406,6 +8406,7 @@ (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 @@ 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 @@ return; } node = *body; + if (newline && node) node->flags |= NODE_FL_NEWLINE; } #undef subnodes -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/