Fix location of assignable nodes

* parse.y (node_assign_gen): In some case assignable nodes
  are created before rhs is created. In this case it is
  needed to set location after rhs is shifted to
  rhs range be included to assignable nodes.

  e.g. The locations of NODE_DASGN_CURR is fixed:

  ```
  a = 10
  ```

  * Before

  ```
  NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1)
  ```

  * After

  ```
  NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yui-knk 2017-11-17 04:25:48 +00:00
Родитель a529ba94e2
Коммит 80facdd93a
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -10119,6 +10119,7 @@ node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs, const YYLTYP
case NODE_CDECL:
case NODE_CVASGN:
lhs->nd_value = rhs;
lhs->nd_loc = *location;
break;
case NODE_ATTRASGN: