diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-18 08:19:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-18 08:19:24 +0000 |
commit | 6c0deb7b87ec4b1e586de59e320e27d648b0e2bb (patch) | |
tree | 3cede9a43a8acf72c5ce93865d993de6a91d9bcd /test | |
parent | 078f8c1af37ae2623a80ca769887664fed5afd95 (diff) | |
download | ruby-6c0deb7b87ec4b1e586de59e320e27d648b0e2bb.tar.gz |
parse.y: fix labelarg
* parse.y (IS_BEG): include labeled argument state, which was
EXPR_LABELARG. [ruby-dev:49221] [Bug #11456]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_syntax.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index c457e2d3a4..e4a623208a 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -310,6 +310,12 @@ WARN assert_valid_syntax("false ? raise do end : tap do end", bug10653) end + def test_paren_after_label + bug11456 = '[ruby-dev:49221] [Bug #11456]' + assert_valid_syntax("{foo: (1 rescue 0)}", bug11456) + assert_valid_syntax("{foo: /=/}", bug11456) + end + def test_duplicated_arg assert_syntax_error("def foo(a, a) end", /duplicated argument name/) assert_nothing_raised { def foo(_, _) end } |