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
3371 3371
		    }
3372 3372
		    {
3373 3373
			$<num>$ = p->max_numparam;
3374
			p->max_numparam = 0;
3374 3375
		    }
3375 3376
		  f_larglist
3376 3377
		    {
test/ruby/test_syntax.rb
1312 1312
    assert_equal(3, eval('[1,2].then {@1+@2}'))
1313 1313
    assert_equal("12", eval('[1,2].then {"#@1#@2"}'))
1314 1314
    assert_equal(3, eval('->{@1+@2}.call(1,2)'))
1315
    assert_equal(4, eval('->(a=->{@1}){a}.call.call(4)'))
1316
    assert_equal(5, eval('-> a: ->{@1} {a}.call.call(5)'))
1315 1317
    assert_syntax_error('proc {|| @1}', /ordinary parameter is defined/)
1316 1318
    assert_syntax_error('proc {|x| @1}', /ordinary parameter is defined/)
1317 1319
    assert_syntax_error('->(){@1}', /ordinary parameter is defined/)
1318
-