mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
ba26f1f836
commit
fa326994ae
1 changed files with 2 additions and 0 deletions
2
parse.y
2
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue