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 | 4c5d7d53b210017ac71ccb958155ba2dc241e220 (patch) | |
tree | 70f177aee18e5c8b554699c75c0dfb10f56154a9 /parse.y | |
parent | 681754c29d4ae02983c61b467f764b036df8f656 (diff) | |
download | ruby-4c5d7d53b210017ac71ccb958155ba2dc241e220.tar.gz |
* 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
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |