aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDominik Kaiser2024-08-29 15:31:07 +0200
committerDominik Kaiser2024-08-29 15:31:07 +0200
commitbc55ab9621c9aa80c12f257d043597188f6ad64d (patch)
tree35e90818efb02ac4359df53232f19cdabd3a9558 /src
parentad4591381f9c3bb713da4d519caeea60ff3b99e7 (diff)
downloadminishell-bc55ab9621c9aa80c12f257d043597188f6ad64d.tar.gz
minishell-bc55ab9621c9aa80c12f257d043597188f6ad64d.zip
Update repl
Diffstat (limited to 'src')
-rw-r--r--src/repl.c15
1 files changed, 5 insertions, 10 deletions
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 <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);
}
}