aboutsummaryrefslogtreecommitdiff
path: root/src/repl.c
diff options
context:
space:
mode:
authorcuhlig2024-08-09 16:26:37 +0200
committerGitHub2024-08-09 16:26:37 +0200
commit8abf7abdc9d49f52c4fcad0afc92730c4c195b7f (patch)
tree2255b668d61572fac185c3d6b5ddf7830a675371 /src/repl.c
parent36d2b4da2887419705cd22eb97a6283be86816f4 (diff)
parente197ecae60b005b0cfe7270f243740ae967bcb7d (diff)
downloadminishell-8abf7abdc9d49f52c4fcad0afc92730c4c195b7f.tar.gz
minishell-8abf7abdc9d49f52c4fcad0afc92730c4c195b7f.zip
Merge pull request #12 from dpu-kaiser/tokenizer
Tokenizer
Diffstat (limited to 'src/repl.c')
-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..1fd7be7 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/08/09 15:27:11 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);
}
}