diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-20 14:42:16 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-20 14:42:16 +0000 |
commit | 86de23e67f33521a5db4a5280a3ec1c36f6354b5 (patch) | |
tree | 70f177aee18e5c8b554699c75c0dfb10f56154a9 | |
parent | cefecc336f7707031b7ac6fce9615b9d662137a4 (diff) | |
download | ruby-86de23e67f33521a5db4a5280a3ec1c36f6354b5.tar.gz ruby-86de23e67f33521a5db4a5280a3ec1c36f6354b5.tar.xz ruby-86de23e67f33521a5db4a5280a3ec1c36f6354b5.zip |
* parse.y (reduce_nodes_gen): preserve NODE_FL_NEWLINE flag during
node reducing. [ruby-core:24463]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.y | 4 |
2 files changed, 9 insertions, 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). @@ -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 |