diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-23 14:15:27 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-23 14:15:27 +0000 |
commit | f8523d35bf3e8ec4a705b1dd45648e1b4352199a (patch) | |
tree | f9e7c6076e8cdbc54a240303740274251079b002 | |
parent | dd979f9d6959919765e20f369ac3fe3ae95958ac (diff) |
parse.y: Fix a location of serial NODE_AND/NODE_OR
* parse.y (logop_gen): Update the last location of
NODE_AND/NODE_OR when NODE is appended to the last.
e.g. The locations of NODE_AND is fixed:
```
a && b && c
```
* Before
```
NODE_AND (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6)
```
* After
```
NODE_AND (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 11)
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | parse.y | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -10637,6 +10637,7 @@ logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *r } node->nd_2nd = NEW_NODE(type, second, right, 0); node->nd_2nd->nd_loc = *location; + left->nd_loc.last_loc = location->last_loc; return left; } op = NEW_NODE(type, left, right, 0); |