Replace two checks with slurp_token
This commit is contained in:
parent
9cc16ed55a
commit
5c37830ef4
1 changed files with 2 additions and 4 deletions
|
@ -687,14 +687,12 @@ sub macro_cond {
|
||||||
my @cases;
|
my @cases;
|
||||||
while (!peek_token($ts,RPAREN))
|
while (!peek_token($ts,RPAREN))
|
||||||
{
|
{
|
||||||
die "Expected ( before case in cond"
|
slurp_token($ts, LPAREN, "Expected ( before case in cond");
|
||||||
unless (shift @$ts)->{type} == LPAREN;
|
|
||||||
|
|
||||||
my $condition = parser_expr($ts);
|
my $condition = parser_expr($ts);
|
||||||
my $work = parser_expr($ts);
|
my $work = parser_expr($ts);
|
||||||
|
|
||||||
die "Expected ) after case in cond"
|
slurp_token($ts, RPAREN, "Expected ) after case in cond");
|
||||||
unless (shift @$ts)->{type} == RPAREN;
|
|
||||||
|
|
||||||
push @cases, {
|
push @cases, {
|
||||||
condition => $condition,
|
condition => $condition,
|
||||||
|
|
Loading…
Reference in a new issue