From 9b4703d4d841366f018555d3b9d5f9377ae5dab1 Mon Sep 17 00:00:00 2001 From: nass1pro Date: Tue, 16 Jun 2020 11:37:22 +0200 Subject: Update lexer/trim --- src/parse/parse.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/parse/parse.c') diff --git a/src/parse/parse.c b/src/parse/parse.c index 1129696..867325b 100755 --- a/src/parse/parse.c +++ b/src/parse/parse.c @@ -47,17 +47,17 @@ t_ret *parse(t_ftlst *input) } } } - // while(ret->ast->cmd_argv != NULL) - // { - // printf("%s\n", ((t_token *)ret->ast->cmd_argv->data)->content); - // ret->ast->cmd_argv = ret->ast->cmd_argv->next; - // } - // while(ret->ast->redirs != NULL) - // { - // printf("%s\n", ((t_token *)ret->ast->redirs->data)->content); - // ret->ast->redirs = ret->ast->redirs->next; - // } - // ast_destroy(ret->ast); - // ft_lstdestroy(&ret->rest, (void (*)(void*))token_destroy); + while(ret->ast->cmd_argv != NULL) + { + printf("[%s]\n", ((t_token *)ret->ast->cmd_argv->data)->content); + ret->ast->cmd_argv = ret->ast->cmd_argv->next; + } + while(ret->ast->redirs != NULL) + { + printf("[%s]\n", ((t_token *)ret->ast->redirs->data)->content); + ret->ast->redirs = ret->ast->redirs->next; + } + ast_destroy(ret->ast); + ft_lstdestroy(&ret->rest, (void (*)(void*))token_destroy); return first; } -- cgit