mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
9a74211026
commit
aaf309972e
1 changed files with 7 additions and 7 deletions
14
parse.y
14
parse.y
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue