ripper: Fix opassign when assignment to backref variables
This commit is contained in:
parent
a1fb6cc978
commit
5695c5df95
2
parse.y
2
parse.y
@ -3382,7 +3382,7 @@ command_asgn : lhs '=' lex_ctxt command_rhs
|
|||||||
rb_backref_error(p, $1);
|
rb_backref_error(p, $1);
|
||||||
/*% %*/
|
/*% %*/
|
||||||
$$ = NEW_ERROR(&@$);
|
$$ = NEW_ERROR(&@$);
|
||||||
/*% ripper[error]: backref_error(p, $1, assign!(var_field(p, get_value($:1)), $:4)) %*/
|
/*% ripper[error]: backref_error(p, $1, opassign!(var_field(p, get_value($:1)), $:2, $:4)) %*/
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
|
|||||||
result =
|
result =
|
||||||
parse('$& += cmd 1, 2', :on_assign_error) {thru_assign_error = true}
|
parse('$& += cmd 1, 2', :on_assign_error) {thru_assign_error = true}
|
||||||
assert_equal true, thru_assign_error
|
assert_equal true, thru_assign_error
|
||||||
assert_equal '[assign_error(assign(var_field($&),command(cmd,[1,2])))]', result
|
assert_equal '[assign_error(opassign(var_field($&),+=,command(cmd,[1,2])))]', result
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_assign_error_const_qualified
|
def test_assign_error_const_qualified
|
||||||
|
Loading…
x
Reference in New Issue
Block a user