aboutsummaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-19 13:45:32 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-19 13:45:32 +0200
commit831cc03ff6c01fb78d77629b7a8f2a75d9e9f75a (patch)
tree9e36ca1c26d850eaba7067ab2d6444052f3e65f7 /src/debug.c
parent35434a76eaab34e4d639f5bd0a3b7ba610001c5e (diff)
downloadminishell-831cc03ff6c01fb78d77629b7a8f2a75d9e9f75a.tar.gz
minishell-831cc03ff6c01fb78d77629b7a8f2a75d9e9f75a.tar.bz2
minishell-831cc03ff6c01fb78d77629b7a8f2a75d9e9f75a.zip
Fixed ast_print
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/debug.c b/src/debug.c
index dd0919e..b23fe51 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -27,6 +27,15 @@ void print_level(int level)
void ast_print(int level, t_ast *ast)
{
+ if (ast->tag == AST_PARENT)
+ {
+ print_level(level);
+ printf("parent: redir [ ");
+ ft_lstiter(ast->redirs, token_put);
+ printf(" ]\n");
+ ast_print(level + 1, ast->parent_ast);
+
+ }
if (ast->tag == AST_CMD)
{
print_level(level);
@@ -40,9 +49,9 @@ void ast_print(int level, t_ast *ast)
{
/* printf("SEP: %d\n", ast->op.sep); */
print_level(level);
- printf("redirs: [");
- ft_lstiter(ast->redirs, token_put);
- printf(" ] ");
+ /* printf("redirs: ["); */
+ /* ft_lstiter(ast->redirs, token_put); */
+ /* printf(" ] "); */
printf("{\n");
print_level(level);