diff options
| author | Dominik Kaiser | 2024-08-29 15:31:07 +0200 |
|---|---|---|
| committer | Dominik Kaiser | 2024-08-29 15:31:07 +0200 |
| commit | bc55ab9621c9aa80c12f257d043597188f6ad64d (patch) | |
| tree | 35e90818efb02ac4359df53232f19cdabd3a9558 /src | |
| parent | ad4591381f9c3bb713da4d519caeea60ff3b99e7 (diff) | |
| download | minishell-bc55ab9621c9aa80c12f257d043597188f6ad64d.tar.gz minishell-bc55ab9621c9aa80c12f257d043597188f6ad64d.zip | |
Update repl
Diffstat (limited to 'src')
| -rw-r--r-- | src/repl.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); } } |
