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:
parent
a529ba94e2
commit
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_CDECL:
|
||||||
case NODE_CVASGN:
|
case NODE_CVASGN:
|
||||||
lhs->nd_value = rhs;
|
lhs->nd_value = rhs;
|
||||||
|
lhs->nd_loc = *location;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NODE_ATTRASGN:
|
case NODE_ATTRASGN:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user