diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-20 01:48:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-20 01:48:43 +0000 |
commit | b0c03f63e5b3865684d8d37e8cac666ba7e0e3e0 (patch) | |
tree | 96a42bddc5ce6514cb9eda0322e87c8c5d7d41c4 /test/ripper | |
parent | 7190c04417a52c29d1dcf6b2f04bb55b30cbfd9f (diff) | |
download | ruby-b0c03f63e5b3865684d8d37e8cac666ba7e0e3e0.tar.gz |
parse.y: quoted ID key
* parse.y (assoc): allow quoted ID as a key of a hash literal.
[ruby-core:34453] [Feature #4276]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_parser_events.rb | 4 | ||||
-rw-r--r-- | test/ripper/test_scanner_events.rb | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index 537d3fc406..1942157b89 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -548,6 +548,10 @@ class TestRipper::ParserEvents < Test::Unit::TestCase thru_dyna_symbol = false parse(':"#{foo}"', :on_dyna_symbol) {thru_dyna_symbol = true} assert_equal true, thru_dyna_symbol + + thru_dyna_symbol = false + parse('{"#{foo}": 1}', :on_dyna_symbol) {thru_dyna_symbol = true} + assert_equal true, thru_dyna_symbol end def test_else diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index ac34ac57df..91903e3dcd 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -878,6 +878,11 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase scan('label', '{foo: 1}') end + def test_label_end + assert_equal %w(":), + scan('label_end', '{"foo-bar": 1}') + end + def test_tlambda assert_equal %w(->), scan('tlambda', '->{}') |