ruby-changes:49266
From: mame <ko1@a...>
Date: Thu, 21 Dec 2017 15:52:19 +0900 (JST)
Subject: [ruby-changes:49266] mame:r61383 (trunk): parse.y: change NODE_SCOPE's nd_loc to one of the parent NODE
mame 2017-12-21 15:52:15 +0900 (Thu, 21 Dec 2017) New Revision: 61383 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61383 Log: parse.y: change NODE_SCOPE's nd_loc to one of the parent NODE This change (ad-hocly) adjusts the code range of NODE_SCOPE in class/module definition because the same adjust is already done in method definition. I intend to just remove inconsistency between class/module definition and method definition, but this kind of adjust is dirty, so it should be fixed later (maybe in 2.6). Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61382) +++ parse.y (revision 61383) @@ -2997,7 +2997,7 @@ primary : literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2997 { /*%%%*/ $$ = NEW_CLASS($2, $5, $3); - $$->nd_body->nd_loc = @5; + $$->nd_body->nd_loc = @$; set_line_body($5, $<num>4); nd_set_line($$, $<num>4); $$->nd_loc = @$; @@ -3020,7 +3020,7 @@ primary : literal https://github.com/ruby/ruby/blob/trunk/parse.y#L3020 { /*%%%*/ $$ = NEW_SCLASS($3, $6); - $$->nd_body->nd_loc = @6; + $$->nd_body->nd_loc = @$; set_line_body($6, nd_line($3)); fixpos($$, $3); $$->nd_loc = @$; @@ -3048,7 +3048,7 @@ primary : literal https://github.com/ruby/ruby/blob/trunk/parse.y#L3048 { /*%%%*/ $$ = NEW_MODULE($2, $4); - $$->nd_body->nd_loc = @4; + $$->nd_body->nd_loc = @$; set_line_body($4, $<num>3); nd_set_line($$, $<num>3); $$->nd_loc = @$; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/