update: splitted stuff into differnt files for run_ast.c
This commit is contained in:
parent
5fb84a3a82
commit
392fd77eca
22 changed files with 1498 additions and 1257 deletions
29
exec/src/run_ast/run_program.c
Normal file
29
exec/src/run_ast/run_program.c
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* run_program.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/14 12:32:04 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/09/14 12:32:20 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "exec/_run_ast.h"
|
||||
|
||||
t_error run_program(t_ast_program *self, t_state *state, t_program_result *out)
|
||||
{
|
||||
t_usize i;
|
||||
|
||||
if (self == NULL || state == NULL || out == NULL)
|
||||
return (ERROR);
|
||||
i = 0;
|
||||
while (i < self->body.len)
|
||||
{
|
||||
if (_run_get_exit_code(self->body.buffer[i], state, &out->exit))
|
||||
return (ERROR);
|
||||
i++;
|
||||
}
|
||||
return (NO_ERROR);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue