diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-28 04:29:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-28 04:29:41 +0000 |
commit | 107b0dc8cdd3c49563bd057c631c1d662d6dfd89 (patch) | |
tree | 85bdbc342c4ebe29ad36b663768967c84789f0f2 /test/ripper | |
parent | edc87841f261b40ba8e4f1e0f7523d2da531dbfd (diff) |
parse.y: fix op_assign type
* parse.y (new_attr_op_assign): fix op_assign type, which is
already an ID since r52284. [Feature #11537]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_parser_events.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index aa222de84f..9fa65fa89b 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -789,6 +789,16 @@ class TestRipper::ParserEvents < Test::Unit::TestCase tree = parse('a::X ||= c 1', :on_opassign) {thru_opassign = true} assert_equal true, thru_opassign assert_equal "[opassign(const_path_field(vcall(a),X),||=,command(c,[1]))]", tree + + thru_opassign = false + tree = parse("self.foo += 1", :on_opassign) {thru_opassign = true} + assert_equal true, thru_opassign + assert_equal "[opassign(field(ref(self),.,foo),+=,1)]", tree + + thru_opassign = false + tree = parse("self.?foo += 1", :on_opassign) {thru_opassign = true} + assert_equal true, thru_opassign + assert_equal "[opassign(field(ref(self),.?,foo),+=,1)]", tree end def test_opassign_error |