Skip to content

Commit 79c2e6e

Browse files
committed
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
1 parent a6a1d7a commit 79c2e6e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

parse.y

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,7 @@ command : fcall command_args %prec tLOWEST
16781678
$$ = method_add_block($$, $3);
16791679
fixpos($$, $1);
16801680
/*%%%*/
1681+
$$->nd_loc = @$;
16811682
nd_set_last_lineno($1, nd_last_lineno($2));
16821683
nd_set_last_column($1, nd_last_column($2));
16831684
/*%
@@ -1694,6 +1695,10 @@ command : fcall command_args %prec tLOWEST
16941695
$$ = new_command_qcall($2, $1, $3, $4, &@$);
16951696
$$ = method_add_block($$, $5);
16961697
fixpos($$, $1);
1698+
/*%%%*/
1699+
$$->nd_loc = @$;
1700+
/*%
1701+
%*/
16971702
}
16981703
| primary_value tCOLON2 operation2 command_args %prec tLOWEST
16991704
{
@@ -1706,6 +1711,10 @@ command : fcall command_args %prec tLOWEST
17061711
$$ = new_command_qcall(ID2VAL(idCOLON2), $1, $3, $4, &@$);
17071712
$$ = method_add_block($$, $5);
17081713
fixpos($$, $1);
1714+
/*%%%*/
1715+
$$->nd_loc = @$;
1716+
/*%
1717+
%*/
17091718
}
17101719
| keyword_super command_args
17111720
{

0 commit comments

Comments
 (0)