aboutsummaryrefslogtreecommitdiff
path: root/src/repl.c
diff options
context:
space:
mode:
authorcuhlig2024-10-17 14:34:33 +0200
committerGitHub2024-10-17 14:34:33 +0200
commit92bdbf67adaf09d1c831db3cee9456e9c447063f (patch)
treea6478101a4cb0e2fb6b7b0d2a3e1b1bef1c0a4b7 /src/repl.c
parenta0016dffa6c5412d7c53b3d9040b837299c50159 (diff)
parent85d82207526e7220bd14bc96e5f8079ec781fc75 (diff)
downloadminishell-92bdbf67adaf09d1c831db3cee9456e9c447063f.tar.gz
minishell-92bdbf67adaf09d1c831db3cee9456e9c447063f.zip
Merge branch 'main' into env
Diffstat (limited to 'src/repl.c')
-rw-r--r--src/repl.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/repl.c b/src/repl.c
index 85d227f..d590fec 100644
--- a/src/repl.c
+++ b/src/repl.c
@@ -3,25 +3,35 @@
/* ::: :::::::: */
/* 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/09/13 16:26:35 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
-#include "minishell.h"
+#include "../include/minishell.h"
+#include "token.h"
void repl(const char *prompt)
{
char *input;
+ t_token *token_list;
+ t_list *lines;
while (1)
{
input = readline(prompt);
if (input == NULL)
return ;
+ if (input[0] == '\0')
+ continue ;
add_history(input);
+ token_list = NULL;
+ tokenizer(input, &token_list, '\0');
+ lines = parse(token_list);
+ if (lines)
+ print_ast(lines->content);
free(input);
}
}