From 919c01e2d111416ba488992635455156cdb9683f Mon Sep 17 00:00:00 2001 From: Adam Shelly Date: Mon, 25 Feb 2008 01:38:19 -0500 Subject: [PATCH] fix for bug#333 - compiler error for block arg + actual block * now passes spec/ruby/1.8/language/method_spec.rb --- shotgun/lib/grammar.y | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shotgun/lib/grammar.y b/shotgun/lib/grammar.y index fccda09..50daf5f 100644 --- a/shotgun/lib/grammar.y +++ b/shotgun/lib/grammar.y @@ -734,7 +734,7 @@ command : operation command_args %prec tLOWEST $$ = new_fcall(parse_state, $1, $2); if ($3) { if (nd_type($$) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); + yyerror("both block arg and actual block given"); } $3->nd_iter = $$; $$ = $3; @@ -751,7 +751,7 @@ command : operation command_args %prec tLOWEST $$ = new_call(parse_state, $1, $3, $4); if ($5) { if (nd_type($$) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); + yyerror("both block arg and actual block given"); } $5->nd_iter = $$; $$ = $5; @@ -768,7 +768,7 @@ command : operation command_args %prec tLOWEST $$ = new_call(parse_state, $1, $3, $4); if ($5) { if (nd_type($$) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); + yyerror("both block arg and actual block given"); } $5->nd_iter = $$; $$ = $5; @@ -1568,7 +1568,7 @@ primary : literal | method_call brace_block { if ($1 && nd_type($1) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); + yyerror("both block arg and actual block given"); } $2->nd_iter = $1; $$ = $2; @@ -1820,8 +1820,8 @@ do_block : kDO_BLOCK block_call : command do_block { - if ($1 && nd_type($1) == NODE_BLOCK_PASS) { - rb_compile_error("both block arg and actual block given"); + if ($1 && nd_type($1) == NODE_BLOCK_PASS) { + yyerror("both block arg and actual block given"); } $2->nd_iter = $1; $$ = $2; -- 1.5.2.5