diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-19 23:59:32 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-19 23:59:32 +0000 |
commit | fa326994aee83d1c1cd4b7cda9ae0d2631d0a13e (patch) | |
tree | 961f48d8d0c99b64692a934645d0ba1a5fd16929 /parse.y | |
parent | ba26f1f836e2ae9c9b5f0b54e55195e22016af3f (diff) | |
download | ruby-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
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; } |