summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-20 06:00:04 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-20 06:00:04 +0000
commit4b279cfdd2e3e4a05e852632f3305c893f6c46a4 (patch)
treed172dbcca9d3d2118639f285aff8cfb6f2e9fd7c /parse.y
parentb7cbe4e2e3df19a2a3b0c7325b32d97cddd4a497 (diff)
downloadruby-4b279cfdd2e3e4a05e852632f3305c893f6c46a4.tar.gz
parse.y: Fix the locations of NODE_FCALL
* parse.y: Update the locations of NODE_FCALL when nd_args is determined. e.g. The locations of NODE_FCALL is fixed: ``` a 1 ``` * Before ``` NODE_FCALL (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1) ``` * After ``` NODE_FCALL (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 3) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60862 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 1776643e81..0ef628b90b 100644
--- a/parse.y
+++ b/parse.y
@@ -1645,6 +1645,8 @@ command : fcall command_args %prec tLOWEST
/*%%%*/
$$ = $1;
$$->nd_args = $2;
+ nd_set_last_lineno($1, nd_last_lineno($2));
+ nd_set_last_column($1, nd_last_column($2));
/*%
$$ = dispatch2(command, $1, $2);
%*/
@@ -1655,6 +1657,11 @@ command : fcall command_args %prec tLOWEST
$$ = new_command($1, $2);
$$ = method_add_block($$, $3);
fixpos($$, $1);
+ /*%%%*/
+ nd_set_last_lineno($1, nd_last_lineno($2));
+ nd_set_last_column($1, nd_last_column($2));
+ /*%
+ %*/
}
| primary_value call_op operation2 command_args %prec tLOWEST
{
@@ -3670,6 +3677,8 @@ method_call : fcall paren_args
/*%%%*/
$$ = $1;
$$->nd_args = $2;
+ nd_set_last_lineno($1, @2.last_loc.lineno);
+ nd_set_last_column($1, @2.last_loc.column);
/*%
$$ = method_arg(dispatch1(fcall, $1), $2);
%*/