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 | 7361cb893f8354eb89b16f587e29ab7a3fec0375 (patch) | |
tree | 4a5b7e5881ea10487b42869ac29bdab597defb19 /parse.y | |
parent | 81cbcbd79bc0ef40afc771e38b2279df637615a6 (diff) | |
download | ruby-7361cb893f8354eb89b16f587e29ab7a3fec0375.tar.gz |
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
Diffstat (limited to 'parse.y')
-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 { |