diff options
author | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-11 23:13:47 +0000 |
---|---|---|
committer | yui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-11 23:13:47 +0000 |
commit | 2d719aef2b4872856b88d4f18cbaa615bece3aee (patch) | |
tree | 23ee84d18c3e69f13b4668fafadd3be53bdae6fe /parse.y | |
parent | 568c0a2dff72459d65e58c0c828144cc5a19438c (diff) |
parse.y: Change locations of NODE_DVAR in NODE_MASGN
* parse.y: Change the last location of NODE_DVAR to
be equal to the first location of NODE_DVAR.
NODE_DVAR of NODE_MASGN (nd_value) is an internal variable,
so it has no length.
e.g. The locations of the NODE_DVAR is changed:
```
a.b {|(c,d)| e}
```
* Before
```
NODE_DVAR (line: 1, code_range: (1,7)-(1,10))
```
* After
```
NODE_DVAR (line: 1, code_range: (1,7)-(1,7))
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -4643,13 +4643,16 @@ f_arg_item : f_arg_asgn | tLPAREN f_margs rparen { ID tid = internal_id(); + YYLTYPE location; + location.first_loc = @2.first_loc; + location.last_loc = @2.first_loc; arg_var(tid); /*%%%*/ if (dyna_in_block()) { - $2->nd_value = new_dvar(tid, &@2); + $2->nd_value = new_dvar(tid, &location); } else { - $2->nd_value = new_lvar(tid, &@2); + $2->nd_value = new_lvar(tid, &location); } $$ = NEW_ARGS_AUX(tid, 1); $$->nd_next = $2; |