ruby-changes:48947
From: yui-knk <ko1@a...>
Date: Thu, 7 Dec 2017 12:00:44 +0900 (JST)
Subject: [ruby-changes:48947] yui-knk:r61066 (trunk): parse.y: Fix locations of dsym
yui-knk 2017-12-07 12:00:36 +0900 (Thu, 07 Dec 2017) New Revision: 61066 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61066 Log: 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)) ``` Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61065) +++ parse.y (revision 61066) @@ -4998,7 +4998,8 @@ assoc : arg_value tASSOC arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L4998 | 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); %*/ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/