summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-20 22:48:05 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-20 22:48:05 +0000
commit45100dbeb2404e62fd2e53bb55a2b86bdeeec2d3 (patch)
tree36ff9e2538e3389f0c34590cc492c02459e1cb12 /parse.y
parent0e7c83e37414f47c47b8efe9f3df1ed640bbd6ca (diff)
downloadruby-45100dbeb2404e62fd2e53bb55a2b86bdeeec2d3.tar.gz
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
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y2
1 files changed, 1 insertions, 1 deletions
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);
%*/