move token print to debug

This commit is contained in:
Quinten Mennen 2025-02-19 17:30:34 +01:00
parent 1e0e78ee10
commit 4621fd2497
3 changed files with 11 additions and 9 deletions

View File

@ -16,5 +16,6 @@
# include "minishell.h"
void print_commands(void *param);
void token_print(void *param);
#endif

View File

@ -27,3 +27,12 @@ void print_commands(void *param)
printf("%s ", command->args[i]);
printf("\n");
}
void token_print(void *param)
{
t_token *token;
token = (t_token *)param;
printf("token type %i, value %s\n", token->type, token->value);
}

View File

@ -14,14 +14,6 @@
#include "minishell.h"
#include "utils.h"
static void token_print(void *param)
{
t_token *token;
token = (t_token *)param;
printf("token type %i, value %s\n", token->type, token->value);
}
int main(int argc, char **argv, char **envp)
{
t_minishell *minishell;
@ -40,7 +32,7 @@ int main(int argc, char **argv, char **envp)
break ;
minishell->lexer = ft_lexer_new(minishell->line);
minishell->tokens = ft_parse_input(minishell->lexer);
ft_lstiter(minishell->tokens, token_print);
//ft_lstiter(minishell->tokens, token_print);
minishell->commands = parser_get_commands(minishell);
simple_builtins(minishell);
free_minishell_line(minishell);