aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Uhlig2024-07-22 14:39:25 +0200
committerChristopher Uhlig2024-07-22 14:39:25 +0200
commitf7df3a73f9d97ae09e9f3e3cd04eafd7824191ce (patch)
tree63d9f58d2a3f00b00047b18fce8e8b904900c7d6
parente0be5c1a5f65107468781b8dd84f2b32d5f12bec (diff)
downloadminishell-f7df3a73f9d97ae09e9f3e3cd04eafd7824191ce.tar.gz
minishell-f7df3a73f9d97ae09e9f3e3cd04eafd7824191ce.zip
added in repl.c tokenizer + visual and free
-rw-r--r--src/repl.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/repl.c b/src/repl.c
index 85d227f..99293e2 100644
--- a/src/repl.c
+++ b/src/repl.c
@@ -3,18 +3,22 @@
/* ::: :::::::: */
/* repl.c :+: :+: :+: */
/* +:+ +:+ +:+ */
-/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/24 16:07:04 by dkaiser #+# #+# */
-/* Updated: 2024/06/25 15:03:00 by dkaiser ### ########.fr */
+/* Updated: 2024/07/15 19:53:52 by chuhlig ### ########.fr */
/* */
/* ************************************************************************** */
-#include "minishell.h"
+#include "../include/minishell.h"
+#include "token.h"
void repl(const char *prompt)
{
char *input;
+ t_token *token_list;
+ t_token *current;
+ t_token *next;
while (1)
{
@@ -22,6 +26,15 @@ void repl(const char *prompt)
if (input == NULL)
return ;
add_history(input);
+ token_list = NULL;
+ tokenizer(input, &token_list);
+ current = token_list;
+ while (current != NULL)
+ {
+ next = current->next;
+ free_token(current);
+ current = next;
+ }
free(input);
}
}