зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
568c0a2dff
Коммит
2d719aef2b
7
parse.y
7
parse.y
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче