mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: Fix the location of a target constant of OP_CDECL
``` p RubyVM::AbstractSyntaxTree.parse("::Foo += 1").children #=> before: [[], nil, (OP_CDECL@1:0-1:10 (COLON3@1:0-1:10 :Foo) :+ (LIT@1:9-1:10 1))] #=> after: [[], nil, (OP_CDECL@1:0-1:10 (COLON3@1:0-1:5 :Foo) :+ (LIT@1:9-1:10 1))] ```
This commit is contained in:
parent
32b18fe9d0
commit
70313ec01a
1 changed files with 2 additions and 1 deletions
3
parse.y
3
parse.y
|
@ -2381,7 +2381,8 @@ arg : lhs '=' lex_ctxt arg_rhs
|
|||
| tCOLON3 tCONSTANT tOP_ASGN lex_ctxt arg_rhs
|
||||
{
|
||||
/*%%%*/
|
||||
$$ = new_const_op_assign(p, NEW_COLON3($2, &@$), $3, $5, $4, &@$);
|
||||
YYLTYPE loc = code_loc_gen(&@1, &@2);
|
||||
$$ = new_const_op_assign(p, NEW_COLON3($2, &loc), $3, $5, $4, &@$);
|
||||
/*% %*/
|
||||
/*% ripper: opassign!(top_const_field!($2), $3, $5) %*/
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue