diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-20 06:00:04 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-20 06:00:04 +0000 |
commit | 4b279cfdd2e3e4a05e852632f3305c893f6c46a4 (patch) | |
tree | d172dbcca9d3d2118639f285aff8cfb6f2e9fd7c /parse.y | |
parent | b7cbe4e2e3df19a2a3b0c7325b32d97cddd4a497 (diff) | |
download | ruby-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.y | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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); %*/ |