diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-17 04:25:48 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-17 04:25:48 +0000 |
commit | 80facdd93a6ed5519ada32b14703967866aa22f1 (patch) | |
tree | aa360e739f13e1182a4172d1a876586547e664ac /parse.y | |
parent | a529ba94e287f257ae879d07ce8d6322259aad4d (diff) | |
download | ruby-80facdd93a6ed5519ada32b14703967866aa22f1.tar.gz |
Fix location of assignable nodes
* parse.y (node_assign_gen): In some case assignable nodes
are created before rhs is created. In this case it is
needed to set location after rhs is shifted to
rhs range be included to assignable nodes.
e.g. The locations of NODE_DASGN_CURR is fixed:
```
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: 6)
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -10119,6 +10119,7 @@ node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs, const YYLTYP case NODE_CDECL: case NODE_CVASGN: lhs->nd_value = rhs; + lhs->nd_loc = *location; break; case NODE_ATTRASGN: |