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

parse.y: Fix the locations of NODE_ITER

* parse.y: Update the locations of NODE_ITER
    when nd_iter is determined.

  e.g. The locations of NODE_ITER is fixed:

  ```
  a {b}
  ```

  * Before

  ```
  NODE_ITER (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 5)
  ```

  * After

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yui-knk 2017-11-18 13:11:36 +00:00
parent fb826d58ee
commit 5fd6558502

View file

@ -2788,6 +2788,7 @@ primary : literal
{
/*%%%*/
$2->nd_iter = $1;
$2->nd_loc = @$;
$$ = $2;
/*%
$$ = method_arg(dispatch1(fcall, $1), arg_new());
@ -2800,6 +2801,7 @@ primary : literal
/*%%%*/
block_dup_check($1->nd_args, $2);
$2->nd_iter = $1;
$2->nd_loc = @$;
$$ = $2;
/*%
$$ = method_add_block($1, $2);
@ -3624,6 +3626,7 @@ block_call : command do_block
block_dup_check($1->nd_args, $2);
}
$2->nd_iter = $1;
$2->nd_loc = @$;
$$ = $2;
fixpos($$, $1);
/*%
@ -3639,6 +3642,7 @@ block_call : command do_block
/*%%%*/
block_dup_check($4, $5);
$5->nd_iter = new_command_qcall($2, $1, $3, $4, &@$);
$5->nd_loc = @$;
$$ = $5;
fixpos($$, $1);
/*%
@ -3651,6 +3655,7 @@ block_call : command do_block
/*%%%*/
block_dup_check($4, $5);
$5->nd_iter = new_command_qcall($2, $1, $3, $4, &@$);
$5->nd_loc = @$;
$$ = $5;
fixpos($$, $1);
/*%