diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-21 04:38:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-21 04:38:46 +0000 |
commit | c924e2db9612bf3ca7aeb169075fdd80fbf545ca (patch) | |
tree | 4bea4e0f74aba505748e88742c93a22d9ad67d93 /test | |
parent | b458aef0f0bbac4e8ab260e2388cf2bc480da5e9 (diff) | |
download | ruby-c924e2db9612bf3ca7aeb169075fdd80fbf545ca.tar.gz |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_syntax.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 |