aboutsummaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-08-27 18:47:16 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-08-27 18:47:16 +0200
commita680cf09a3fa4b7c6adc38e4297ee5535172826b (patch)
tree461c9110aadbc98ea2e8751ddb51c48d5c508304 /src/debug.c
parentb4002940ce1c1c4648b24f6bf942fc4e4ebab098 (diff)
downloadminishell-a680cf09a3fa4b7c6adc38e4297ee5535172826b.tar.gz
minishell-a680cf09a3fa4b7c6adc38e4297ee5535172826b.tar.bz2
minishell-a680cf09a3fa4b7c6adc38e4297ee5535172826b.zip
Updated preprocessing, redir, ast to use t_tok_lst instead of t_ftlst
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/src/debug.c b/src/debug.c
index c2b416e..8255016 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -3,66 +3,66 @@
#include "lexer.h"
#include "ast.h"
-void token_debug(void *v)
-{
- t_token *t;
-
- t= v;
- printf("[%4d %d] (%s)\n", t->tag, !!(t->tag & TAG_STICK), t->content);
-}
-
-void token_put(void *v)
-{
- t_token *t;
-
- t= v;
- printf("%s ", t->content);
-}
-
-void print_level(int level)
-{
- while (level-- > 0)
- printf(" ");
-}
-
-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);
- }
- else if (ast->tag == AST_CMD)
- {
- print_level(level);
- printf("cmd: [ ");
- ft_lstiter(ast->cmd_argv, token_put);
- printf(" ] redirs: [");
- ft_lstiter(ast->redirs, token_put);
- printf(" ]");
- }
- else if (ast->tag == AST_OP) {
- /* printf("SEP: %d\n", ast->op.sep); */
- print_level(level);
- /* printf("redirs: ["); */
- /* ft_lstiter(ast->redirs, token_put); */
- /* printf(" ] "); */
- printf("{\n");
-
- print_level(level);
- printf(" left:\n");
- ast_print(level + 1, ast->op.left);
-
- printf("\n");
- print_level(level);
- printf(" right:\n");
- ast_print(level + 1, ast->op.right);
-
- printf("\n");
- print_level(level);
- printf("}\n");
- }
-}
+/* void token_debug(void *v) */
+/* { */
+/* t_token *t; */
+/* */
+/* t= v; */
+/* printf("[%4d %d] (%s)\n", t->tag, !!(t->tag & TAG_STICK), t->content); */
+/* } */
+/* */
+/* void token_put(void *v) */
+/* { */
+/* t_token *t; */
+/* */
+/* t= v; */
+/* printf("%s ", t->content); */
+/* } */
+/* */
+/* void print_level(int level) */
+/* { */
+/* while (level-- > 0) */
+/* printf(" "); */
+/* } */
+/* */
+/* 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); */
+/* } */
+/* else if (ast->tag == AST_CMD) */
+/* { */
+/* print_level(level); */
+/* printf("cmd: [ "); */
+/* ft_lstiter(ast->cmd_argv, token_put); */
+/* printf(" ] redirs: ["); */
+/* ft_lstiter(ast->redirs, token_put); */
+/* printf(" ]"); */
+/* } */
+/* else if (ast->tag == AST_OP) { */
+/* #<{(| printf("SEP: %d\n", ast->op.sep); |)}># */
+/* print_level(level); */
+/* #<{(| printf("redirs: ["); |)}># */
+/* #<{(| ft_lstiter(ast->redirs, token_put); |)}># */
+/* #<{(| printf(" ] "); |)}># */
+/* printf("{\n"); */
+/* */
+/* print_level(level); */
+/* printf(" left:\n"); */
+/* ast_print(level + 1, ast->op.left); */
+/* */
+/* printf("\n"); */
+/* print_level(level); */
+/* printf(" right:\n"); */
+/* ast_print(level + 1, ast->op.right); */
+/* */
+/* printf("\n"); */
+/* print_level(level); */
+/* printf("}\n"); */
+/* } */
+/* } */