refactor: removed duplicate code for while/until loops in parser

This commit is contained in:
Gu://em_ 2026-01-30 20:00:44 +01:00
parent 423793903d
commit 9f967dc9b4
2 changed files with 78 additions and 98 deletions

View file

@ -349,7 +349,15 @@ struct ast *parse_shell_command(struct lexer_context *ctx)
{
return parse_if_rule(ctx);
}
// TODO loops and case
else if (is_first(*token, RULE_WHILE))
{
return parse_while(ctx);
}
else if (is_first(*token, RULE_UNTIL))
{
return parse_until(ctx);
}
// TODO for and case
else
{
perror("Syntax error: unexpected token in parse_shell_command");