summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 08:54:34 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 08:54:34 +0000
commit79c2e6eccf9ba1d3197d179351761104baadfa63 (patch)
tree6a8f770d13bd722dc21e67e8339ebd9ed1cfd611 /parse.y
parenta6a1d7ab21338f48ca42b4ad4d1c1d1fd6ed3a38 (diff)
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
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y9
1 files changed, 9 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 44fa2fd6d6..1026d5c896 100644
--- a/parse.y
+++ b/parse.y
@@ -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
{