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 /parse.y | |
| 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
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 |
