diff options
| author | Christopher Uhlig | 2025-01-23 18:41:18 +0100 |
|---|---|---|
| committer | Christopher Uhlig | 2025-01-23 18:41:18 +0100 |
| commit | 18fb7cb8ae69fc3439266a154aa6b0f947d6805d (patch) | |
| tree | 2cbdd7ab727d82cb69ea7acc431e2ffcc317e4ff /src/debug_tools.c | |
| parent | 202a5a26d1c0411c441cf12be2b22318abc4f3f9 (diff) | |
| download | minishell-18fb7cb8ae69fc3439266a154aa6b0f947d6805d.tar.gz minishell-18fb7cb8ae69fc3439266a154aa6b0f947d6805d.zip | |
a
Diffstat (limited to 'src/debug_tools.c')
| -rw-r--r-- | src/debug_tools.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/debug_tools.c b/src/debug_tools.c index 6bee1b0..2c8ee7e 100644 --- a/src/debug_tools.c +++ b/src/debug_tools.c @@ -6,13 +6,15 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/24 15:34:14 by dkaiser #+# #+# */ -/* Updated: 2025/01/20 12:50:36 by chuhlig ### ########.fr */ +/* Updated: 2025/01/23 15:21:11 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ #include "debug_tools.h" #include <stdio.h> #include <stdarg.h> +#include "token.h" +#include <stdio.h> void dbg(char *msg) { @@ -33,3 +35,21 @@ void panic(char *msg) ft_putendl_fd("\e[0m", 1); } } + + + +void print_token_list(t_token *token_list) { + t_token *current = token_list; + while (current != NULL) { + if (current->type == STRING_TOKEN) { + printf("STRING_TOKEN: %s\n", current->content.string); + } else if (current->type == REDIR_TOKEN) { + printf("REDIR_TOKEN: %d\n", current->content.redir_type); + } else if (current->type == PIPE_TOKEN) { + printf("PIPE_TOKEN\n"); + } else if (current->type == NEWLINE_TOKEN) { + printf("NEWLINE_TOKEN\n"); + } + current = current->next; + } +} |
