diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-26 23:33:23 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-26 23:33:23 +0000 |
commit | 62b5c62f3d7f0dd1ad4f7ad6da4898a11f990bf3 (patch) | |
tree | bc080b4c17da269596280dc8a948ecc2f5774a35 /parse.y | |
parent | a9968933978c1ec0db3a7cc88d46507028918bfc (diff) | |
download | ruby-62b5c62f3d7f0dd1ad4f7ad6da4898a11f990bf3.tar.gz |
parse.y: Fix the last location of NODE_OPT_ARG
* parse.y (opt_arg_append): Update the last location of
NODE_OPT_ARG when NODE is appended to the last.
e.g. The locations of the first NODE_OPT_ARG is fixed:
```
def a(b = 1, c = 2); end
```
* Before
```
NODE_OPT_ARG (line: 1, first_lineno: 1, first_column: 6, last_lineno: 1, last_column: 11)
```
* After
```
NODE_OPT_ARG (line: 1, first_lineno: 1, first_column: 6, last_lineno: 1, last_column: 18)
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -9343,9 +9343,11 @@ static NODE * opt_arg_append(NODE *opt_list, NODE *opt) { NODE *opts = opt_list; + opts->nd_loc.last_loc = opt->nd_loc.last_loc; while (opts->nd_next) { opts = opts->nd_next; + opts->nd_loc.last_loc = opt->nd_loc.last_loc; } opts->nd_next = opt; |