move token print to debug
This commit is contained in:
parent
1e0e78ee10
commit
4621fd2497
@ -16,5 +16,6 @@
|
|||||||
# include "minishell.h"
|
# include "minishell.h"
|
||||||
|
|
||||||
void print_commands(void *param);
|
void print_commands(void *param);
|
||||||
|
void token_print(void *param);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -27,3 +27,12 @@ void print_commands(void *param)
|
|||||||
printf("%s ", command->args[i]);
|
printf("%s ", command->args[i]);
|
||||||
printf("\n");
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
10
src/main.c
10
src/main.c
@ -14,14 +14,6 @@
|
|||||||
#include "minishell.h"
|
#include "minishell.h"
|
||||||
#include "utils.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)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
t_minishell *minishell;
|
t_minishell *minishell;
|
||||||
@ -40,7 +32,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
break ;
|
break ;
|
||||||
minishell->lexer = ft_lexer_new(minishell->line);
|
minishell->lexer = ft_lexer_new(minishell->line);
|
||||||
minishell->tokens = ft_parse_input(minishell->lexer);
|
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);
|
minishell->commands = parser_get_commands(minishell);
|
||||||
simple_builtins(minishell);
|
simple_builtins(minishell);
|
||||||
free_minishell_line(minishell);
|
free_minishell_line(minishell);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user