Project

General

Profile

Bug #15789 » fix-numbered-parameter-in-optarg-default-value-v2.patch

jeremyevans0 (Jeremy Evans), 05/05/2019 04:46 AM

View differences:

parse.y
}
{
$<num>$ = p->max_numparam;
p->max_numparam = 0;
}
f_larglist
{
test/ruby/test_syntax.rb
assert_equal(3, eval('[1,2].then {@1+@2}'))
assert_equal("12", eval('[1,2].then {"#@1#@2"}'))
assert_equal(3, eval('->{@1+@2}.call(1,2)'))
assert_equal(4, eval('->(a=->{@1}){a}.call.call(4)'))
assert_equal(5, eval('-> a: ->{@1} {a}.call.call(5)'))
assert_syntax_error('proc {|| @1}', /ordinary parameter is defined/)
assert_syntax_error('proc {|x| @1}', /ordinary parameter is defined/)
assert_syntax_error('->(){@1}', /ordinary parameter is defined/)
(2-2/2)