1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

parse.y: Fix locations of NODE_ARRAY of mlhs_head

* parse.y: Fix to only include a range of mlhs_item
  (exclude ',' form range).

  e.g. The locations of the NODE_ARRAY is fixed:

  ```
  (a,) = 1,2
  ```

  * Before

  ```
  NODE_ARRAY (line: 1, code_range: (1,1)-(1,3))
  ```

  * After

  ```
  NODE_ARRAY (line: 1, code_range: (1,1)-(1,2))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yui-knk 2017-12-12 01:13:56 +00:00
parent a1061f557b
commit f1c3395099

View file

@ -1877,7 +1877,7 @@ mlhs_item : mlhs_node
mlhs_head : mlhs_item ','
{
/*%%%*/
$$ = new_list($1, &@$);
$$ = new_list($1, &@1);
/*%
$$ = mlhs_add(mlhs_new(), $1);
%*/