From 62b5c62f3d7f0dd1ad4f7ad6da4898a11f990bf3 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 26 Nov 2017 23:33:23 +0000 Subject: [PATCH] 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 --- parse.y | 2 ++ 1 file changed, 2 insertions(+) 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;