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; 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,