зеркало из https://github.com/github/ruby.git
parse.y: Fix locations of dsym
* parse.y (dsym_node_gen): Always set locations to include locations of tSYMBEG and tSTRING_END. e.g. The locations of the NODE_LIT is fixed: ``` :"a" ``` * Before ``` NODE_LIT (line: 1, code_range: (1,2)-(1,3)) ``` * After ``` NODE_LIT (line: 1, code_range: (1,0)-(1,4)) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
2c018e9646
Коммит
acf7e52d88
2
parse.y
2
parse.y
|
@ -10842,11 +10842,13 @@ dsym_node_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location)
|
|||
switch (nd_type(node)) {
|
||||
case NODE_DSTR:
|
||||
nd_set_type(node, NODE_DSYM);
|
||||
nd_set_loc(node, location);
|
||||
break;
|
||||
case NODE_STR:
|
||||
lit = node->nd_lit;
|
||||
add_mark_object(node->nd_lit = ID2SYM(rb_intern_str(lit)));
|
||||
nd_set_type(node, NODE_LIT);
|
||||
nd_set_loc(node, location);
|
||||
break;
|
||||
default:
|
||||
node = NEW_NODE(NODE_DSYM, Qnil, 1, new_list(node, location));
|
||||
|
|
Загрузка…
Ссылка в новой задаче