From 79c2e6eccf9ba1d3197d179351761104baadfa63 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Tue, 12 Dec 2017 08:54:34 +0000 Subject: [PATCH] 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 --- parse.y | 9 +++++++++ 1 file changed, 9 insertions(+) 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 {