From: Mauricio Fernandez Date: 2005-08-08T01:26:37+09:00 Subject: [BUG] incorrect parse in 1.9; [PATCH] included One of the f_larglist productions is broken: it makes ruby parse invalid expressions as shown below: $ ~/ruby1.9/bin/ruby -ve "b = 1; ->a, , &b *c {}; p 1 " ruby 1.9.0 (2005-08-06) [i686-linux] 1 Proposed fix: --- parse.y.orig 2005-08-07 17:41:44.000000000 +0200 +++ parse.y 2005-08-07 18:10:08.000000000 +0200 @@ -3208,7 +3208,7 @@ $$ = dispatch4(params, $1, Qnil, Qnil, Qnil); %*/ } - | f_arg ',' opt_f_block_arg f_rest_arg opt_bv_decl + | f_arg ',' f_rest_arg opt_f_block_arg opt_bv_decl { /*%%%*/ $$ = NEW_LAMBDA(new_args($1, 0, $3, $4), $5); After applying the patch: $ ./ruby -ve "b = 1; ->a, , &b *c {}.call(1)" ruby 1.9.0 (2005-08-06) [i686-linux] -e:1: syntax error b = 1; ->a, , &b *c {}.call(1) ^ -e:1: warning: useless use of * in void context $ ./ruby -ve "b = 1; ->a, *c {}.call(1)" ruby 1.9.0 (2005-08-06) [i686-linux] $ ./ruby -ve "b = 1; ->a, *c {p a, :X, *c}.call(1,2,3,4)" ruby 1.9.0 (2005-08-06) [i686-linux] 1 :X 2 3 4 -- Mauricio Fernandez