summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-09 09:44:03 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-09 09:44:03 +0000
commit51d863e06ac1071570bf8a2c2668a6a415f31f93 (patch)
treec1bd59db3a37e1ddddd1036de0e9b439e6cb9921 /parse.y
parent7a79d88161009dcdadc12d61c66037e7ef0864a0 (diff)
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
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y5
1 files changed, 4 insertions, 1 deletions
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);