Skip to content

Commit

Permalink
parse.y: use opt_paren_args to simplify yield rule
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Nov 27, 2016
1 parent 36fc1f1 commit 27ceb84
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions mrbgems/mruby-compiler/core/parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -2137,17 +2137,9 @@ primary : literal
{
$$ = new_return(p, 0);
}
| keyword_yield '(' call_args rparen
| keyword_yield opt_paren_args
{
$$ = new_yield(p, $3);
}
| keyword_yield '(' rparen
{
$$ = new_yield(p, 0);
}
| keyword_yield
{
$$ = new_yield(p, 0);
$$ = new_yield(p, $2);
}
| keyword_not '(' expr rparen
{
Expand Down

0 comments on commit 27ceb84

Please sign in to comment.