summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-07 03:00:36 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-07 03:00:36 +0000
commit803d1753b7a3ad8db3b1643181a5b4c8f51da40b (patch)
treee90184f9f02959526a4cecd48a6353b5846bfaee /parse.y
parentacf7e52d8804e138fadf6b3efd2ad09dcb5cd0de (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.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 62ceedb8c5..109c227e09 100644
--- a/parse.y
+++ b/parse.y
@@ -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);
%*/