style: normed the source folder

This commit is contained in:
Raphael 2024-10-11 16:23:18 +02:00
parent 286796700c
commit 1dfb7f7ef7
3 changed files with 24 additions and 24 deletions

View file

@ -64,7 +64,8 @@ void exec_shcat(t_state *state)
vec_ast_push(&prog->data.program.body, state->ast); vec_ast_push(&prog->data.program.body, state->ast);
state->ast = prog; state->ast = prog;
} }
if (state->ast != NULL && run_program(&state->ast->data.program, state, &prog_res)) if (state->ast != NULL && run_program(&state->ast->data.program, state,
&prog_res))
printf("Error when execting the Command \n"); printf("Error when execting the Command \n");
ast_free(state->ast); ast_free(state->ast);
} }
@ -82,7 +83,7 @@ void ft_take_args(t_state *state)
if (parse_str(state)) if (parse_str(state))
{ {
mem_free(state->str_input); mem_free(state->str_input);
continue; continue ;
} }
exec_shcat(state); exec_shcat(state);
mem_free(state->str_input); mem_free(state->str_input);

View file

@ -14,7 +14,6 @@
#include "me/hashmap/hashmap_env.h" #include "me/hashmap/hashmap_env.h"
#include "me/mem/mem.h" #include "me/mem/mem.h"
void ft_free(void *ptr) void ft_free(void *ptr)
{ {
if (!ptr) if (!ptr)

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */ /* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/28 14:40:38 by rparodi #+# #+# */ /* Created: 2024/03/28 14:40:38 by rparodi #+# #+# */
/* Updated: 2024/10/10 17:47:24 by maiboyer ### ########.fr */ /* Updated: 2024/10/11 16:21:01 by rparodi ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -42,7 +42,8 @@ void ft_take_args(t_state *state);
void ast_free(t_ast_node node); void ast_free(t_ast_node node);
t_error split_str_first(t_const_str s, char splitter, t_str *before, t_str *after) t_error split_str_first(t_const_str s, char splitter, t_str *before,
t_str *after)
{ {
t_usize i; t_usize i;
@ -92,7 +93,6 @@ t_error parse_str(t_state *state)
return (ERROR); return (ERROR);
if (ts_apply_passes(tokens, &tokens)) if (ts_apply_passes(tokens, &tokens))
return (ERROR); return (ERROR);
ts_print(&tokens); // TODO: remove
if (yarn(tokens, &ast)) if (yarn(tokens, &ast))
return ((void)printf("failed to ast build\n"), (ERROR)); return ((void)printf("failed to ast build\n"), (ERROR));
if (ast.len != 1) if (ast.len != 1)