From 831cc03ff6c01fb78d77629b7a8f2a75d9e9f75a Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 19 Jun 2020 13:45:32 +0200 Subject: Fixed ast_print --- src/parse/parse.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/parse/parse.c') diff --git a/src/parse/parse.c b/src/parse/parse.c index cc4d56d..02357da 100755 --- a/src/parse/parse.c +++ b/src/parse/parse.c @@ -6,7 +6,7 @@ /* By: nahaddac +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/06/17 18:09:04 by nahaddac #+# #+# */ -/* Updated: 2020/06/19 13:28:12 by nahaddac ### ########.fr */ +/* Updated: 2020/06/19 13:38:23 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -118,7 +118,7 @@ t_ret *parse_expr(t_ftlst *input) return (NULL); input = input->next; t_ast *new_ast = ast_new(AST_PARENT); - new_ast = tmp->ast; + new_ast->parent_ast = tmp->ast; tmp->ast = new_ast; if (tag & TAG_IS_REDIR) { @@ -145,17 +145,17 @@ t_ret *parse(t_ftlst *input) t_ret *ret; t_ftlst *in_f; - in_f = input; - if (input == NULL) - return NULL; - if (!(ret = malloc(sizeof(t_ret) * 1))) - return (NULL); - ret->ast = NULL; - ret->rest = NULL; - if((ret->unexpected = error_syntax_simple(input)) != NULL) - printf("%s\n", ret->unexpected->content); - ret = parse_op(in_f); - ast_destroy(ret->ast); - ft_lstdestroy(&ret->rest, (void (*)(void*))token_destroy); - return (NULL); + /* in_f = input; */ + /* if (input == NULL) */ + /* return NULL; */ + /* if (!(ret = malloc(sizeof(t_ret) * 1))) */ + /* return (NULL); */ + /* ret->ast = NULL; */ + /* ret->rest = NULL; */ + /* if((ret->unexpected = error_syntax_simple(input)) != NULL) */ + /* printf("%s\n", ret->unexpected->content); */ + ret = parse_op(input); + /* ast_destroy(ret->ast); */ + /* ft_lstdestroy(&ret->rest, (void (*)(void*))token_destroy); */ + return (ret); } -- cgit