diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-10 23:27:58 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-10 23:27:58 +0000 |
commit | 04fe6b019b35f31c21f7777d3adfa1bda9d8da72 (patch) | |
tree | 882190530d78b25456496dbc222416cc60c3e39c /parse.y | |
parent | 2dcb4d2a347a52487717128a615de5984e255e5d (diff) | |
download | ruby-04fe6b019b35f31c21f7777d3adfa1bda9d8da72.tar.gz |
parse.y: Change the first location of NODE_ARRAY in NODE_DSTR (nd_next->nd_next)
* parse.y (list_append_gen): Change the first location to
start with the location of item if new list is generated.
e.g. The locations of the NODE_ARRAY is changed:
```
"#{a}.#{b}"
```
* Before
```
NODE_ARRAY (line: 1, code_range: (1,0)-(1,6))
```
* After
```
NODE_ARRAY (line: 1, code_range: (1,5)-(1,6))
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -9039,7 +9039,7 @@ list_append_gen(struct parser_params *parser, NODE *list, NODE *item, const YYLT { NODE *last; - if (list == 0) return new_list(item, location); + if (list == 0) return new_list(item, &item->nd_loc); if (list->nd_next) { last = list->nd_next->nd_end; } @@ -9048,7 +9048,7 @@ list_append_gen(struct parser_params *parser, NODE *list, NODE *item, const YYLT } list->nd_alen += 1; - last->nd_next = new_list(item, location); + last->nd_next = new_list(item, &item->nd_loc); list->nd_next->nd_end = last->nd_next; nd_set_last_lineno(list, nd_last_lineno(item)); |