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
This commit is contained in:
yui-knk 2017-12-07 23:35:59 +00:00
parent c02174354e
commit f026add396

View File

@ -3942,6 +3942,10 @@ string : tCHAR
string1 : tSTRING_BEG string_contents tSTRING_END
{
$$ = new_string1(heredoc_dedent($2));
/*%%%*/
if ($$) nd_set_loc($$, &@$);
/*%
%*/
}
;