From 0ea778d8126245d80b38b7238467ff7e2aba051a Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 9 Jan 2018 13:04:24 +0000 Subject: 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 --- test/ruby/test_syntax.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3