1
0
Fork 0
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:
yui-knk 2017-11-19 23:59:32 +00:00
parent ba26f1f836
commit fa326994ae

View file

@ -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;
}