ruby-changes:48970
From: yui-knk <ko1@a...>
Date: Sat, 9 Dec 2017 12:03:39 +0900 (JST)
Subject: [ruby-changes:48970] yui-knk:r61089 (trunk): parse.y: Fix locations of NODE_SCOPE in NODE_CLASS
yui-knk 2017-12-09 12:03:34 +0900 (Sat, 09 Dec 2017) New Revision: 61089 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61089 Log: parse.y: Fix locations of NODE_SCOPE in NODE_CLASS * parse.y: Fix to only include a range of bodystmt. e.g. The locations of the NODE_SCOPE is fixed: ``` class A def a; end end ``` * Before ``` NODE_SCOPE (line: 3, code_range: (1,0)-(3,3)) ``` * After ``` NODE_SCOPE (line: 3, code_range: (1,7)-(3,3)) ``` Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61088) +++ parse.y (revision 61089) @@ -2973,7 +2973,7 @@ primary : literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2973 { /*%%%*/ $$ = NEW_CLASS($2, $5, $3); - $$->nd_body->nd_loc = @$; + $$->nd_body->nd_loc = @5; set_line_body($5, $<num>4); nd_set_line($$, $<num>4); $$->nd_loc = @$; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/