Skip to content

Commit

Permalink
Fix locations of NODE_UNDEF in undef with multiple args
Browse files Browse the repository at this point in the history
* parse.y: Fix the beginning position of trailing NODE_UNDEF.

  e.g. The location of the NODE_UNDEF for `b` is fixed:

  ```
  undef a, b
  ```

  * Before

  ```
  NODE_UNDEF (line: 1, location: (1,6)-(1,10))
  ```

  * After

  ```
  NODE_UNDEF (line: 1, location: (1,9)-(1,10))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
yui-knk committed Nov 25, 2018
1 parent 9a4d120 commit dd78257
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ undef_list : fitem
| undef_list ',' {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
{
/*%%%*/
NODE *undef = NEW_UNDEF($4, &@$);
NODE *undef = NEW_UNDEF($4, &@4);
$$ = block_append(p, $1, undef);
/*% %*/
/*% ripper: rb_ary_push($1, get_value($4)) %*/
Expand Down

0 comments on commit dd78257

Please sign in to comment.