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