Skip to content

Commit

Permalink
moved return/break/next from command_call for better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Jan 14, 2012
1 parent fec23ae commit fa0ddc3
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions parse.y
Expand Up @@ -1217,30 +1217,6 @@ expr_value : expr

command_call : command
| block_command
| keyword_return call_args
{
/*%%%*/
$$ = NEW_RETURN(ret_args($2));
/*%
$$ = dispatch1(return, $2);
%*/
}
| keyword_break call_args
{
/*%%%*/
$$ = NEW_BREAK(ret_args($2));
/*%
$$ = dispatch1(break, $2);
%*/
}
| keyword_next call_args
{
/*%%%*/
$$ = NEW_NEXT(ret_args($2));
/*%
$$ = dispatch1(next, $2);
%*/
}
;

block_command : block_call
Expand Down Expand Up @@ -1363,6 +1339,30 @@ command : operation command_args %prec tLOWEST
$$ = dispatch1(yield, $2);
%*/
}
| keyword_return call_args
{
/*%%%*/
$$ = NEW_RETURN(ret_args($2));
/*%
$$ = dispatch1(return, $2);
%*/
}
| keyword_break call_args
{
/*%%%*/
$$ = NEW_BREAK(ret_args($2));
/*%
$$ = dispatch1(break, $2);
%*/
}
| keyword_next call_args
{
/*%%%*/
$$ = NEW_NEXT(ret_args($2));
/*%
$$ = dispatch1(next, $2);
%*/
}
;

mlhs : mlhs_basic
Expand Down

0 comments on commit fa0ddc3

Please sign in to comment.