summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-19 02:39:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-19 02:39:09 +0000
commitec8f8fa4c803ab9e71d1b38f5c0e32a3d2ffe0a9 (patch)
treec21f2e9866684931c7e7436e9991fb859a974946 /test
parent6f22777fcf1612052c7f2884935f805d53f991d1 (diff)
parse.y: lparen_arg statement
* parse.y (primary): allow parenthesised statement as a method argument. [Feature #12686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55965 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 ce013583be..c135cec4ea 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -827,6 +827,11 @@ eom
end
end
+ def test_parenthesised_statement_argument
+ assert_syntax_error("foo(bar rescue nil)", /unexpected modifier_rescue/)
+ assert_valid_syntax("foo (bar rescue nil)")
+ end
+
private
def not_label(x) @result = x; @not_label ||= nil end