refactor: removed duplicate code for while/until loops in parser
This commit is contained in:
parent
423793903d
commit
9f967dc9b4
2 changed files with 78 additions and 98 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue