diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-07 02:48:38 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-07 02:48:38 +0000 |
commit | acf7e52d8804e138fadf6b3efd2ad09dcb5cd0de (patch) | |
tree | 6bfc66c46541a99bf35e603e03776f13963ebfb2 /parse.y | |
parent | 2c018e9646436ca1320cce3fc06c1ef8dfcdee5d (diff) | |
download | ruby-acf7e52d8804e138fadf6b3efd2ad09dcb5cd0de.tar.gz |
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
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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)); |