diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-16 01:56:54 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-16 01:56:54 +0000 |
commit | 575993d74386157a9554e2b4f9f350d673be9613 (patch) | |
tree | 4a5b7e5881ea10487b42869ac29bdab597defb19 | |
parent | b465633fcc00ec29f4a901fac96ad17bdcddc652 (diff) |
parse.y: Fix location of asgn node
* parse.y (new_op_assign_gen): Fix location of asgn node.
Assignable node (e.g. NODE_LASGN) is generated before rhs
is generated, so we reset the location when nd_value of
asgn is fixed.
e.g. :
```
a -= 10
```
* Before
```
NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1)
```
* After
```
NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 7)
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | parse.y | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -10865,6 +10865,7 @@ new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, con else { asgn = lhs; asgn->nd_value = new_call(gettable(vid, location), op, new_list(rhs, location), location); + asgn->nd_loc = *location; } } else { |