Replace two checks with slurp_token

This commit is contained in:
madmaurice 2021-04-06 23:34:16 +02:00
parent 9cc16ed55a
commit 5c37830ef4

View file

@ -687,14 +687,12 @@ sub macro_cond {
my @cases;
while (!peek_token($ts,RPAREN))
{
die "Expected ( before case in cond"
unless (shift @$ts)->{type} == LPAREN;
slurp_token($ts, LPAREN, "Expected ( before case in cond");
my $condition = parser_expr($ts);
my $work = parser_expr($ts);
die "Expected ) after case in cond"
unless (shift @$ts)->{type} == RPAREN;
slurp_token($ts, RPAREN, "Expected ) after case in cond");
push @cases, {
condition => $condition,