ruby-changes:48983
From: yui-knk <ko1@a...>
Date: Mon, 11 Dec 2017 09:06:15 +0900 (JST)
Subject: [ruby-changes:48983] yui-knk:r61102 (trunk): parse.y: Fix locations of NODE_SCOPE in NODE_MODULE
yui-knk 2017-12-11 09:06:11 +0900 (Mon, 11 Dec 2017) New Revision: 61102 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61102 Log: parse.y: Fix locations of NODE_SCOPE in NODE_MODULE * parse.y: Fix to only include a range of bodystmt. e.g. The locations of the NODE_SCOPE is fixed: ``` module M def m end end ``` * Before ``` NODE_SCOPE (line: 4, code_range: (1,0)-(4,3)) ``` * After ``` NODE_SCOPE (line: 4, code_range: (1,8)-(4,3)) ``` Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61101) +++ parse.y (revision 61102) @@ -3030,7 +3030,7 @@ primary : literal https://github.com/ruby/ruby/blob/trunk/parse.y#L3030 { /*%%%*/ $$ = NEW_MODULE($2, $4); - $$->nd_body->nd_loc = @$; + $$->nd_body->nd_loc = @4; set_line_body($4, $<num>3); nd_set_line($$, $<num>3); $$->nd_loc = @$; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/