ruby-changes:48973
From: yui-knk <ko1@a...>
Date: Sat, 9 Dec 2017 12:53:04 +0900 (JST)
Subject: [ruby-changes:48973] yui-knk:r61092 (trunk): parse.y: Fix locations of NODE_SCOPE in NODE_SCLASS
yui-knk 2017-12-09 12:52:59 +0900 (Sat, 09 Dec 2017) New Revision: 61092 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61092 Log: parse.y: Fix locations of NODE_SCOPE in NODE_SCLASS * parse.y: Fix to only include a range of bodystmt. e.g. The locations of the NODE_SCOPE is fixed: ``` class << [] def m; end end ``` * Before ``` NODE_SCOPE (line: 3, code_range: (1,0)-(3,3)) ``` * After ``` NODE_SCOPE (line: 3, code_range: (2,2)-(3,3)) ``` Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61091) +++ parse.y (revision 61092) @@ -2996,7 +2996,7 @@ primary : literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2996 { /*%%%*/ $$ = NEW_SCLASS($3, $6); - $$->nd_body->nd_loc = @$; + $$->nd_body->nd_loc = @6; set_line_body($6, nd_line($3)); fixpos($$, $3); $$->nd_loc = @$; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/