From 51d863e06ac1071570bf8a2c2668a6a415f31f93 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sat, 9 Dec 2017 09:44:03 +0000 Subject: parse.y: Change locations of NODE_BLOCK in NODE_RESBODY (nd_body) * parse.y: Change to only include a range from exc_var to compstmt. e.g. The locations of the NODE_BLOCK is changed: ``` begin :a rescue E => e :b end ``` * Before ``` NODE_BLOCK (line: 3, code_range: (3,0)-(5,3)) ``` * After ``` NODE_BLOCK (line: 3, code_range: (3,9)-(4,4)) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index cd3440e3ce..0ebc24109d 100644 --- a/parse.y +++ b/parse.y @@ -3849,8 +3849,11 @@ opt_rescue : keyword_rescue exc_list exc_var then { /*%%%*/ if ($3) { + YYLTYPE location; + location.first_loc = @3.first_loc; + location.last_loc = @5.last_loc; $3 = node_assign($3, new_errinfo(&@3), &@3); - $5 = block_append($3, $5, &@$); + $5 = block_append($3, $5, &location); } $$ = new_resbody($2, $5, $6, &@$); fixpos($$, $2?$2:$5); -- cgit v1.2.3