ruby-changes:48953
From: yui-knk <ko1@a...>
Date: Fri, 8 Dec 2017 08:36:06 +0900 (JST)
Subject: [ruby-changes:48953] yui-knk:r61072 (trunk): parse.y: Fix locations of string
yui-knk 2017-12-08 08:35:59 +0900 (Fri, 08 Dec 2017) New Revision: 61072 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61072 Log: 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)) ``` Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61071) +++ parse.y (revision 61072) @@ -3942,6 +3942,10 @@ string : tCHAR https://github.com/ruby/ruby/blob/trunk/parse.y#L3942 string1 : tSTRING_BEG string_contents tSTRING_END { $$ = new_string1(heredoc_dedent($2)); + /*%%%*/ + if ($$) nd_set_loc($$, &@$); + /*% + %*/ } ; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/