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 (cmd_brace_block)

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

  ```
  a (1) {|i|}
  ```

  * Before

  ```
  NODE_ITER (line: 1, code_range: (1,6)-(1,10))
  ```

  * After

  ```
  NODE_ITER (line: 1, code_range: (1,0)-(1,11))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yui-knk 2017-12-12 08:54:34 +00:00
parent a6a1d7ab21
commit 79c2e6eccf

View file

@ -1678,6 +1678,7 @@ command : fcall command_args %prec tLOWEST
$$ = method_add_block($$, $3);
fixpos($$, $1);
/*%%%*/
$$->nd_loc = @$;
nd_set_last_lineno($1, nd_last_lineno($2));
nd_set_last_column($1, nd_last_column($2));
/*%
@ -1694,6 +1695,10 @@ command : fcall command_args %prec tLOWEST
$$ = new_command_qcall($2, $1, $3, $4, &@$);
$$ = method_add_block($$, $5);
fixpos($$, $1);
/*%%%*/
$$->nd_loc = @$;
/*%
%*/
}
| primary_value tCOLON2 operation2 command_args %prec tLOWEST
{
@ -1706,6 +1711,10 @@ command : fcall command_args %prec tLOWEST
$$ = new_command_qcall(ID2VAL(idCOLON2), $1, $3, $4, &@$);
$$ = method_add_block($$, $5);
fixpos($$, $1);
/*%%%*/
$$->nd_loc = @$;
/*%
%*/
}
| keyword_super command_args
{