Updated WIP

This commit is contained in:
Maieul BOYER 2024-09-02 16:28:13 +02:00
parent 7540096f6d
commit 993efe4287
No known key found for this signature in database
11 changed files with 170 additions and 426 deletions

View file

@ -6,13 +6,12 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/30 17:56:29 by rparodi #+# #+# */
/* Updated: 2024/08/30 17:58:54 by rparodi ### ########.fr */
/* Updated: 2024/09/02 13:45:52 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "exec/_run_arith.h"
#include "me/types.h"
#include "me/convert/str_to_numbers.h"
/// ADD OPERATOR STUFF
t_error _binary_get_op(t_ast_arithmetic_operator op, t_arith_op_func *out)

View file

@ -0,0 +1,50 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* operator_bis.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/02 13:45:46 by maiboyer #+# #+# */
/* Updated: 2024/09/02 13:50:59 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "exec/_run_arith.h"
#include "me/types.h"
t_error _postfix_op_dec(t_ast_node self, t_state *state, t_i64 *out)
{
(void)(self);
(void)(state);
(void)(out);
return (ERROR);
}
t_error _postfix_op_inc(t_ast_node self, t_state *state, t_i64 *out)
{
(void)(self);
(void)(state);
(void)(out);
return (ERROR);
}
t_error _unary_op_minus(t_ast_node self, t_state *state, t_i64 *out)
{
t_i64 val;
(void)(self);
(void)(state);
(void)(out);
if (_get_node_number(self, state, &val))
return (ERROR);
val = -val;
*out = val;
return (NO_ERROR);
}
t_error _unary_op_plus(t_ast_node self, t_state *state, t_i64 *out)
{
return (_get_node_number(self, state, out));
}