aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-21 04:38:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-21 04:38:46 +0000
commit22ae147ffb6b330108010fd0182e36276f69b2e1 (patch)
tree4bea4e0f74aba505748e88742c93a22d9ad67d93 /test/ruby/test_syntax.rb
parente7ccad5865cad6fd2abe89e8fa6da7045522b604 (diff)
downloadruby-22ae147ffb6b330108010fd0182e36276f69b2e1.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/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb8
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