summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-07 23:35:59 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-07 23:35:59 +0000
commitf026add396e8c3bbf165aaaabd3b51597bee7546 (patch)
treec39c629fcb64b14af32f226e0e21a0a27cf20113 /parse.y
parentc02174354e6e963b0375fb8faf0b6045ec27a43f (diff)
parse.y: Fix locations of string
* parse.y: Fix to include locations of tSTRING_BEG and tSTRING_END. e.g. The locations of the NODE_STR is fixed: ``` "a" ``` * Before ``` NODE_STR (line: 1, code_range: (1,1)-(1,2)) ``` * After ``` NODE_STR (line: 1, code_range: (1,0)-(1,3)) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 12d278a131..e18c50c194 100644
--- a/parse.y
+++ b/parse.y
@@ -3942,6 +3942,10 @@ string : tCHAR
string1 : tSTRING_BEG string_contents tSTRING_END
{
$$ = new_string1(heredoc_dedent($2));
+ /*%%%*/
+ if ($$) nd_set_loc($$, &@$);
+ /*%
+ %*/
}
;