diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-17 07:39:15 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-17 07:39:15 +0000 |
commit | 114fc2201c660347b19c13df937bc3f46cc03434 (patch) | |
tree | 23d6e9e7fcfaa8b59f47d9a9c1cb7a63f1f10592 /parse.y | |
parent | d2bb08ecf02fccbe8e5d9723af21cfe454c3cf29 (diff) | |
download | ruby-114fc2201c660347b19c13df937bc3f46cc03434.tar.gz |
Fix location of assignable nodes
* parse.y (node_assign_gen): NODE_ATTRASGN is created
before rhs is created. It is needed to set location
after rhs is created to rhs range be included to the
location of NODE_ATTRASGN.
e.g. The locations of NODE_ATTRASGN is fixed:
```
a[1] = 2
```
* Before
```
NODE_ATTRASGN (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 4)
```
* After
```
NODE_ATTRASGN (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 8)
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -10125,6 +10125,7 @@ node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs, const YYLTYP case NODE_ATTRASGN: case NODE_CALL: lhs->nd_args = arg_append(lhs->nd_args, rhs, location); + lhs->nd_loc = *location; break; default: |