ruby-changes:49027
From: yui-knk <ko1@a...>
Date: Tue, 12 Dec 2017 17:54:40 +0900 (JST)
Subject: [ruby-changes:49027] yui-knk:r61142 (trunk): parse.y: Fix the locations of NODE_ITER (cmd_brace_block)
yui-knk 2017-12-12 17:54:34 +0900 (Tue, 12 Dec 2017) New Revision: 61142 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61142 Log: 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)) ``` Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61141) +++ parse.y (revision 61142) @@ -1678,6 +1678,7 @@ command : fcall command_args %pre https://github.com/ruby/ruby/blob/trunk/parse.y#L1678 $$ = 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 %pre https://github.com/ruby/ruby/blob/trunk/parse.y#L1695 $$ = 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 %pre https://github.com/ruby/ruby/blob/trunk/parse.y#L1711 $$ = new_command_qcall(ID2VAL(idCOLON2), $1, $3, $4, &@$); $$ = method_add_block($$, $5); fixpos($$, $1); + /*%%%*/ + $$->nd_loc = @$; + /*% + %*/ } | keyword_super command_args { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/