aboutsummaryrefslogtreecommitdiff
path: root/src/repl.c
diff options
context:
space:
mode:
authorcuhlig2024-12-17 15:22:32 +0100
committerGitHub2024-12-17 15:22:32 +0100
commita93558047c6d04ca4181fa84229d82b09dd7def2 (patch)
treea0b67075c625731e1e1d526db46eb5dec81b5616 /src/repl.c
parent8cbba6da72ddd04e358bdb893e700702f92adacd (diff)
parentae5512ea0d6d8be833ca3a9b39f93239109f45b4 (diff)
downloadminishell-a93558047c6d04ca4181fa84229d82b09dd7def2.tar.gz
minishell-a93558047c6d04ca4181fa84229d82b09dd7def2.zip
Merge branch 'main' into bugfix-tokenizer
Diffstat (limited to 'src/repl.c')
-rw-r--r--src/repl.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/repl.c b/src/repl.c
index fe9faf3..d590fec 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/09/13 16:26:35 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -17,24 +17,21 @@ void repl(const char *prompt)
{
char *input;
t_token *token_list;
- t_token *current;
- t_token *next;
+ t_list *lines;
while (1)
{
input = readline(prompt);
if (input == NULL)
return ;
+ if (input[0] == '\0')
+ continue ;
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);
}
}