diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-09 13:04:24 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-09 13:04:24 +0000 |
commit | c9d349dafc4584974c72109037d9a1e7e88569f0 (patch) | |
tree | 34c09b541b77489e33be5ba32f5b3662a54680ce /test/ruby/test_syntax.rb | |
parent | 2085183400baac047edc2ce3b18da4a8ebf92ee1 (diff) | |
download | ruby-c9d349dafc4584974c72109037d9a1e7e88569f0.tar.gz |
parse.y: insane syntax too (class definition in cond)
This change partially reverts r61724 and take another approach:
exploiting struct local_vars to backup the cond_stack state.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r-- | test/ruby/test_syntax.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index bf9f4998ac..a1af048a2b 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1186,6 +1186,11 @@ eom assert_valid_syntax('while def foo a = tap do end; end; break; end') end + def test_classdef_in_cond + assert_valid_syntax('while class Foo; tap do end; end; break; end') + assert_valid_syntax('while class Foo a = tap do end; end; break; end') + end + private def not_label(x) @result = x; @not_label ||= nil end |