Updated makefiles and better error reporting

This commit is contained in:
Maieul BOYER 2024-07-26 13:54:49 +02:00
parent 5ed7952cc7
commit 58fc4ecc78
No known key found for this signature in database
10 changed files with 94 additions and 74 deletions

View file

@ -12,7 +12,10 @@
#include "../../include/function_declaration.h"
void ast_print_node_file_redirection_heredoc(t_ast_node self);
void ast_print_node_file_redirection_heredoc(t_ast_node self)
{
(void)(self);
}
//{
// if (self->data.file_redirection.op == AST_REDIR_HEREDOC)
// printf("<<");

View file

@ -56,34 +56,34 @@ void ast_print_node_program(t_ast_node self)
}
}
void ast_print_node_compound_statement(t_ast_node self)
{
t_usize i;
// void ast_print_node_compound_statement(t_ast_node self)
// {
// t_usize i;
if (self == NULL)
return ;
if (self->kind != AST_COMPOUND_STATEMENT)
return ;
i = 0;
if (self->data.compound_statement.bang)
printf("! ");
printf("{ ");
while (i < self->data.compound_statement.body.len)
{
ast_print_node(self->data.compound_statement.body.buffer[i++]);
printf(" ");
}
printf("}");
i = 0;
while (i < self->data.compound_statement.suffixes_redirections.len)
{
printf(" ");
ast_print_node \
(self->data.compound_statement.suffixes_redirections.buffer[i++]);
}
printf(" ");
_print_term(self->data.compound_statement.term);
}
// if (self == NULL)
// return ;
// if (self->kind != AST_COMPOUND_STATEMENT)
// return ;
// i = 0;
// if (self->data.compound_statement.bang)
// printf("! ");
// printf("{ ");
// while (i < self->data.compound_statement.body.len)
// {
// ast_print_node(self->data.compound_statement.body.buffer[i++]);
// printf(" ");
// }
// printf("}");
// i = 0;
// while (i < self->data.compound_statement.suffixes_redirections.len)
// {
// printf(" ");
// ast_print_node \
// (self->data.compound_statement.suffixes_redirections.buffer[i++]);
// }
// printf(" ");
// _print_term(self->data.compound_statement.term);
// }
void ast_print_node_compound_statement(t_ast_node self)
{

View file

@ -62,7 +62,7 @@ void ast_print_node(t_ast_node self)
if (self->kind == AST_ELSE)
return (ast_print_node_else(self));
if (self->kind == AST_EMPTY)
return (ast_print_node_empty(self));
return ;
if (self->kind == AST_EXPANSION)
return (ast_print_node_expansion(self));
if (self->kind == AST_EXTGLOB)