aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-26 23:33:23 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-26 23:33:23 +0000
commitf0e5d7961f414103024fb26b3caf1d243106d77d (patch)
treebc080b4c17da269596280dc8a948ecc2f5774a35 /parse.y
parentd320da32548b3f38b9a45ddb330bf4bc1337dc18 (diff)
downloadruby-f0e5d7961f414103024fb26b3caf1d243106d77d.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.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 07797c05d9..18a0f36f99 100644
--- a/parse.y
+++ b/parse.y
@@ -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;