From 22ae147ffb6b330108010fd0182e36276f69b2e1 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 21 Sep 2016 04:38:46 +0000 Subject: parse.y: do after cmdarg in paren * parse.y: `do` after cmdarg in parentheses should be `do_block` and bound to the outer method. [ruby-core:72482] [Bug #11873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_syntax.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index c135cec4ea..965ef3e577 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -832,6 +832,14 @@ eom assert_valid_syntax("foo (bar rescue nil)") end + def test_cmdarg_in_paren + bug11873 = '[ruby-core:72482] [Bug #11873]' + assert_valid_syntax %q{a b{c d}, :e do end}, bug11873 + assert_valid_syntax %q{a b(c d), :e do end}, bug11873 + assert_valid_syntax %q{a b{c(d)}, :e do end}, bug11873 + assert_valid_syntax %q{a b(c(d)), :e do end}, bug11873 + end + private def not_label(x) @result = x; @not_label ||= nil end -- cgit v1.2.3