diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-11 02:19:43 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-11 02:19:43 +0000 |
commit | aaf309972eca59c5e103f5fe9747e22076ec39d9 (patch) | |
tree | e708c17442e03fd78a1059723fb9fae7540e21fc /parse.y | |
parent | 9a742110263e8003e51e76062224e909a236e4a6 (diff) |
parse.y: Fix locations of NODE_DSTR generated by evstr2dstr_gen
* parse.y (evstr2dstr_gen): Fix to only include a range of node.
e.g. The locations of the NODE_DSTR is fixed:
```
%W[a #{b} c]
```
* Before
```
NODE_DSTR (line: 1, code_range: (1,3)-(1,9))
```
* After
```
NODE_DSTR (line: 1, code_range: (1,5)-(1,9))
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -433,8 +433,8 @@ static NODE *literal_concat_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE* static int literal_concat0(struct parser_params *, VALUE, VALUE); static NODE *new_evstr_gen(struct parser_params*,NODE*,const YYLTYPE*); #define new_evstr(n, location) new_evstr_gen(parser,(n),(location)) -static NODE *evstr2dstr_gen(struct parser_params*,NODE*,const YYLTYPE*); -#define evstr2dstr(n,location) evstr2dstr_gen(parser,(n),(location)) +static NODE *evstr2dstr_gen(struct parser_params*,NODE*); +#define evstr2dstr(n) evstr2dstr_gen(parser,(n)) static NODE *splat_array(NODE*); static NODE *call_bin_op_gen(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*); @@ -3931,7 +3931,7 @@ strings : string node = new_str(STR_NEW0(), &@$); } else { - node = evstr2dstr(node, &@$); + node = evstr2dstr(node); } $$ = node; /*% @@ -4001,7 +4001,7 @@ word_list : /* none */ | word_list word ' ' { /*%%%*/ - $$ = list_append($1, evstr2dstr($2, &@$)); + $$ = list_append($1, evstr2dstr($2)); /*% $$ = dispatch2(words_add, $1, $2); %*/ @@ -4047,7 +4047,7 @@ symbol_list : /* none */ | symbol_list word ' ' { /*%%%*/ - $2 = evstr2dstr($2, &@$); + $2 = evstr2dstr($2); if (nd_type($2) == NODE_DSTR) { nd_set_type($2, NODE_DSYM); } @@ -9200,10 +9200,10 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail, const Y } static NODE * -evstr2dstr_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location) +evstr2dstr_gen(struct parser_params *parser, NODE *node) { if (nd_type(node) == NODE_EVSTR) { - node = list_append(new_dstr(STR_NEW0(), location), node); + node = list_append(new_dstr(STR_NEW0(), &node->nd_loc), node); } return node; } |