aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-09 03:03:34 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-09 03:03:34 +0000
commit15c3e4e92cd88c4875f3a6fe19ae2d4c13cbd423 (patch)
treec98aec6588ec9be2a7f21838f4ea68165533206b
parent230f54130ef2b58b70c9128675d01c2b9cf67516 (diff)
downloadruby-15c3e4e92cd88c4875f3a6fe19ae2d4c13cbd423.tar.gz
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)) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--parse.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index e84c3002ae..1c3fe00893 100644
--- a/parse.y
+++ b/parse.y
@@ -2973,7 +2973,7 @@ primary : literal
{
/*%%%*/
$$ = 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 = @$;