diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-07 03:00:36 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-07 03:00:36 +0000 |
commit | 803d1753b7a3ad8db3b1643181a5b4c8f51da40b (patch) | |
tree | e90184f9f02959526a4cecd48a6353b5846bfaee /parse.y | |
parent | acf7e52d8804e138fadf6b3efd2ad09dcb5cd0de (diff) |
parse.y: Fix locations of dsym
* parse.y: Fix to only include a range from tSTRING_BEG to tLABEL_END.
e.g. The locations of the NODE_LIT is fixed:
```
{ "a": 10 }
```
* Before
```
NODE_LIT (line: 1, code_range: (1,2)-(1,9))
```
* After
```
NODE_LIT (line: 1, code_range: (1,2)-(1,6))
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4998,7 +4998,8 @@ assoc : arg_value tASSOC arg_value | tSTRING_BEG string_contents tLABEL_END arg_value { /*%%%*/ - $$ = list_append(new_list(dsym_node($2, &@$), &@$), $4, &@$); + YYLTYPE location = {@1.first_loc, @3.last_loc}; + $$ = list_append(new_list(dsym_node($2, &location), &location), $4, &@$); /*% $$ = dispatch2(assoc_new, dispatch1(dyna_symbol, $2), $4); %*/ |