summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-01 21:32:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-01 21:32:04 +0000
commit0a190272cdbe182eea4d27407c680370dd8afde8 (patch)
treebe4cb1bc1fa1883fdfa3e0558c672ac4088a40f7 /parse.y
parent1549a6b78daaa4f3efa1d47eb6c9e52b080578b8 (diff)
parse.y: preserve tSTRING_CONTENT results
* parse.y (ripper_flush_string_content): preserve the dispatched results at tSTRING_CONTENT. [ruby-dev:48714] [Bug #10437] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y9
1 files changed, 6 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index a50047eeb5..13a0f480ec 100644
--- a/parse.y
+++ b/parse.y
@@ -6302,6 +6302,8 @@ static void
ripper_flush_string_content(struct parser_params *parser, rb_encoding *enc)
{
VALUE content = yylval.val;
+ if (!ripper_is_node_yylval(content))
+ content = ripper_new_yylval(0, 0, content);
if (!NIL_P(parser->delayed)) {
ptrdiff_t len = lex_p - parser->tokp;
if (len > 0) {
@@ -6309,11 +6311,12 @@ ripper_flush_string_content(struct parser_params *parser, rb_encoding *enc)
}
ripper_dispatch_delayed_token(parser, tSTRING_CONTENT);
parser->tokp = lex_p;
+ RNODE(content)->nd_rval = yylval.val;
}
- if (!ripper_is_node_yylval(content))
- content = ripper_new_yylval(0, 0, content);
- yylval.val = content;
ripper_dispatch_scan_event(parser, tSTRING_CONTENT);
+ if (yylval.val != content)
+ RNODE(content)->nd_rval = yylval.val;
+ yylval.val = content;
}
#define flush_string_content(enc) ripper_flush_string_content(parser, (enc))