parsing: refactor group_or_simple_parse into group_cmd_parse.c

This commit is contained in:
Khaïs COLIN 2025-04-16 13:08:17 +02:00
parent a5103fa733
commit 73d691c0b4
7 changed files with 24 additions and 24 deletions

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/31 10:28:28 by jguelen #+# #+# */
/* Updated: 2025/04/16 13:02:53 by khais ### ########.fr */
/* Updated: 2025/04/16 13:07:33 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,9 +16,7 @@
#include "worddesc/worddesc.h"
#include "wordlist/wordlist.h"
#include <unistd.h>
#include "simple_cmd/simple_cmd_parse.h"
#include "cmd/cmd_destroy.h"
#include "group_cmd/group_cmd_parse.h"
#include "pipeline/pipeline_parse.h"
#include "cmd/opt_cmds_parse.h"
@ -29,17 +27,6 @@ void parse_error(t_minishell *app, t_worddesc *token)
app->last_return_value = 2;
}
t_cmd *minishell_group_or_simple_parse(t_minishell *app, t_wordlist **tokens)
{
if ((*tokens)->word->token_type == OPEN_PARENTH_TOKEN)
{
worddesc_destroy(wordlist_pop(tokens));
return (minishell_group_cmd_parse(app, tokens));
}
else
return (minishell_simple_cmd_parse(app, tokens));
}
/*
** Parse list of commands or pipeline.
*/