diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-19 02:39:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-19 02:39:09 +0000 |
commit | 6e11d9517902762f823d6ecc882ab46f3d69f035 (patch) | |
tree | c21f2e9866684931c7e7436e9991fb859a974946 /test | |
parent | e678f2a5307efff27d2cb735fa02a881891f8e14 (diff) | |
download | ruby-6e11d9517902762f823d6ecc882ab46f3d69f035.tar.gz |
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.rb | 5 |
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 |