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 | 0ea778d8126245d80b38b7238467ff7e2aba051a (patch) | |
tree | 34c09b541b77489e33be5ba32f5b3662a54680ce /test | |
parent | 82e986c286fe1547cde8998e0a13860d057fe12e (diff) |
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')
-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 |