summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-26 13:31:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-26 13:31:03 +0000
commitb4aa884f06ee5c40f88e90f312ea6b31c120f308 (patch)
treec223d1ecce9642743b444096a7998d6be48245df /test
parenta5c391026c1b8aa070d067c4c4a6e3bec59ef1f9 (diff)
parse.y: preserve cmdarg stack
* parse.y (do_body): preserve cmdarg stack around do/end block. [ruby-core:78837] [Bug #13073] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 3e6212e27c..f40f15316b 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -917,6 +917,15 @@ eom
end
end
+ def test_do_block_in_hash_brace
+ bug13073 = '[ruby-core:78837] [Bug #13073]'
+ assert_valid_syntax 'p :foo, {a: proc do end, b: proc do end}', bug13073
+ assert_valid_syntax 'p :foo, {:a => proc do end, b: proc do end}', bug13073
+ assert_valid_syntax 'p :foo, {"a": proc do end, b: proc do end}', bug13073
+ assert_valid_syntax 'p :foo, {** proc do end, b: proc do end}', bug13073
+ assert_valid_syntax 'p :foo, {proc do end => proc do end, b: proc do end}', bug13073
+ end
+
def test_do_after_local_variable
obj = Object.new
def obj.m; yield; end