diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-12 03:15:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-12 03:15:34 +0000 |
commit | 549a3b74c49537ec7b7e9cc82e17803ded1ca3da (patch) | |
tree | 6375b9d6a836036e30596b9b9f405e8f9688c7ce /test/ripper | |
parent | 01134984ef51c4dfc7aebf4f3a371de9c8ddcce5 (diff) |
ripper: fix %-op on_operator_ambiguous
* parse.y (ambiguous_operator): separate token and string
representation of operators, to fix %-operator argument. in a
warning message, needs to be escaped by '%' but the symbol
should not be.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_parser_events.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index 7af2019a09..7eac20a3ec 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -173,8 +173,14 @@ class TestRipper::ParserEvents < Test::Unit::TestCase def test_operator_ambiguous thru_operator_ambiguous = false - parse('a=1; a %[]', :on_operator_ambiguous) {thru_operator_ambiguous = true} + token = syntax = nil + parse('a=1; a %[]', :on_operator_ambiguous) {|*a| + thru_operator_ambiguous = true + _, token, syntax = *a + } assert_equal true, thru_operator_ambiguous + assert_equal :%, token + assert_equal "string literal", syntax end def test_array # array literal |