From 45100dbeb2404e62fd2e53bb55a2b86bdeeec2d3 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Mon, 20 Nov 2017 22:48:05 +0000 Subject: parse.y: Set the last location of NODE_ARRAY in %i * parse.y: list_append uses the locations of the second argument. So we should set the locations of $2 before pass it to list_append. e.g. The locations of NODE_ARRAY is fixed: ``` %i[a b] ``` * Before ``` NODE_ARRAY (line: 1, first_lineno: 1, first_column: 0, last_lineno: 0, last_column: -1) ``` * After ``` NODE_ARRAY (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 7) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 0ef628b90b..16026abcc4 100644 --- a/parse.y +++ b/parse.y @@ -4124,8 +4124,8 @@ qsym_list : /* none */ lit = $2->nd_lit; nd_set_type($2, NODE_LIT); add_mark_object($2->nd_lit = ID2SYM(rb_intern_str(lit))); - $$ = list_append($1, $2, &@$); $2->nd_loc = @$; + $$ = list_append($1, $2, &@$); /*% $$ = dispatch2(qsymbols_add, $1, $2); %*/ -- cgit v1.2.3