From: Dominik Kaiser Date: Thu, 29 Aug 2024 13:31:07 +0000 (+0200) Subject: Update repl X-Git-Url: https://git.dkaiser.de/?a=commitdiff_plain;h=bc55ab9621c9aa80c12f257d043597188f6ad64d;p=42%2Fminishell.git Update repl --- diff --git a/src/repl.c b/src/repl.c index fe9faf3..01bcd76 100644 --- a/src/repl.c +++ b/src/repl.c @@ -6,7 +6,7 @@ /* By: chuhlig +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/24 16:07:04 by dkaiser #+# #+# */ -/* Updated: 2024/08/11 14:41:29 by chuhlig ### ########.fr */ +/* Updated: 2024/08/29 15:29:16 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,8 +17,7 @@ void repl(const char *prompt) { char *input; t_token *token_list; - t_token *current; - t_token *next; + t_list *lines; while (1) { @@ -27,14 +26,10 @@ void repl(const char *prompt) return ; add_history(input); token_list = NULL; - current = token_list; tokenizer(input, &token_list, '\0'); - while (current != NULL) - { - next = current->next; - free_token(current); - current = next; - } + lines = parse(token_list); + if (lines) + print_ast(lines->content); free(input); } }