aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-19 23:59:32 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-19 23:59:32 +0000
commitfa326994aee83d1c1cd4b7cda9ae0d2631d0a13e (patch)
tree961f48d8d0c99b64692a934645d0ba1a5fd16929
parentba26f1f836e2ae9c9b5f0b54e55195e22016af3f (diff)
downloadruby-fa326994aee83d1c1cd4b7cda9ae0d2631d0a13e.tar.gz
Update the last location of NODE_BLOCK
* parse.y (block_append_gen): Update the last location of NODE_BLOCK when a tail is appended. e.g. The locations of NODE_BLOCK is fixed: ``` a; b; c ``` * Before ``` NODE_BLOCK (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 4) ``` * After ``` NODE_BLOCK (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 7) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--parse.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 70a9aaad39..1776643e81 100644
--- a/parse.y
+++ b/parse.y
@@ -9015,6 +9015,8 @@ block_append_gen(struct parser_params *parser, NODE *head, NODE *tail, const YYL
}
end->nd_next = tail;
h->nd_end = tail->nd_end;
+ nd_set_last_lineno(head, nd_last_lineno(tail));
+ nd_set_last_column(head, nd_last_column(tail));
return head;
}