diff options
-rw-r--r-- | parse.y | 1 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 2 |
2 files changed, 3 insertions, 0 deletions
@@ -3307,6 +3307,7 @@ opt_block_param : none block_param_def : '|' opt_bv_decl '|' { p->cur_arg = 0; + p->max_numparam = -1; /*%%%*/ $$ = 0; /*% %*/ diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index ff8c62f6a1..f2df65fb6c 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1313,6 +1313,8 @@ eom assert_equal("12", eval('[1,2].then {"#@1#@2"}')) assert_equal(3, eval('->{@1+@2}.call(1,2)')) assert_syntax_error('proc {|| @1}', /ordinary parameter is defined/) + assert_syntax_error('proc {|;a| @1}', /ordinary parameter is defined/) + assert_syntax_error("proc {|\n| @1}", /ordinary parameter is defined/) assert_syntax_error('proc {|x| @1}', /ordinary parameter is defined/) assert_syntax_error('->(){@1}', /ordinary parameter is defined/) assert_syntax_error('->(x){@1}', /ordinary parameter is defined/) |