diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-20 22:48:05 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-20 22:48:05 +0000 |
commit | 45100dbeb2404e62fd2e53bb55a2b86bdeeec2d3 (patch) | |
tree | 36ff9e2538e3389f0c34590cc492c02459e1cb12 /parse.y | |
parent | 0e7c83e37414f47c47b8efe9f3df1ed640bbd6ca (diff) | |
download | ruby-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.y | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); %*/ |