diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-06-19 13:45:32 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-06-19 13:45:32 +0200 |
| commit | 831cc03ff6c01fb78d77629b7a8f2a75d9e9f75a (patch) | |
| tree | 9e36ca1c26d850eaba7067ab2d6444052f3e65f7 /src/parse/parse.c | |
| parent | 35434a76eaab34e4d639f5bd0a3b7ba610001c5e (diff) | |
| download | minishell-831cc03ff6c01fb78d77629b7a8f2a75d9e9f75a.tar.gz minishell-831cc03ff6c01fb78d77629b7a8f2a75d9e9f75a.tar.bz2 minishell-831cc03ff6c01fb78d77629b7a8f2a75d9e9f75a.zip | |
Fixed ast_print
Diffstat (limited to 'src/parse/parse.c')
| -rwxr-xr-x | src/parse/parse.c | 30 |
1 files changed, 15 insertions, 15 deletions
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 <nahaddac@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); } |
