summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-19 06:38:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-19 06:38:31 +0000
commitc501345218dc5fb0fae90d56a0c6fd19d38df5bb (patch)
tree8196b0407f41f8e1c8046dc73cfea0b7999c4460 /test
parent95de2b001247b5e8ccd89d5ba7225d42aafec1e5 (diff)
parse.y: allow parenthesed do-block in cmdarg
* parse.y (primary): flush cmdarg flags inside left-paren in a command argument, to allow parenthesed do-block as an argument without arguments parentheses. [ruby-core:61950] [Bug #9726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index bc1d80f990..0847c28bfc 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -78,6 +78,11 @@ class TestSyntax < Test::Unit::TestCase
end
end
+ def test_do_block_in_cmdarg
+ bug9726 = '[ruby-core:61950] [Bug #9726]'
+ assert_valid_syntax("tap (proc do end)", __FILE__, bug9726)
+ end
+
def test_keyword_rest
bug5989 = '[ruby-core:42455]'
assert_valid_syntax("def kwrest_test(**a) a; end", __FILE__, bug5989)