From 4f66a053a327cc1c3a7ec5179bad602893145aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Mon, 2 Sep 2024 11:35:48 +0200 Subject: [PATCH] Norming the ast/from_node --- ast/src/from_node/dev_node.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/ast/src/from_node/dev_node.c b/ast/src/from_node/dev_node.c index cc0c762c..cc71d903 100644 --- a/ast/src/from_node/dev_node.c +++ b/ast/src/from_node/dev_node.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/08/09 15:07:10 by rparodi #+# #+# */ -/* Updated: 2024/08/14 17:28:46 by maiboyer ### ########.fr */ +/* Updated: 2024/09/02 11:35:32 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,9 +20,10 @@ #include "parser/api.h" #include -t_error build_sym_negated_command(t_parse_node self, t_const_str input, t_ast_node *out) +t_error build_sym_negated_command(\ + t_parse_node self, t_const_str input, t_ast_node *out) { - t_ast_node ret; + t_ast_node ret; (void)(out); (void)(input); @@ -39,12 +40,13 @@ t_error build_sym_negated_command(t_parse_node self, t_const_str input, t_ast_no return (*out = ret, NO_ERROR); } -t_error build_sym_pipeline(t_parse_node self, t_const_str input, t_ast_node *out) +t_error build_sym_pipeline(\ + t_parse_node self, t_const_str input, t_ast_node *out) { - t_ast_node ret; - t_ast_node tmp; - t_ast_node tmp2; - t_usize i; + t_ast_node ret; + t_ast_node tmp; + t_ast_node tmp2; + t_usize i; (void)(out); (void)(input); @@ -58,7 +60,7 @@ t_error build_sym_pipeline(t_parse_node self, t_const_str input, t_ast_node *out while (i < ts_node_child_count(self)) { if (!ts_node_is_named(ts_node_child(self, i)) && (i++, true)) - continue; + continue ; if (ast_from_node(ts_node_child(self, i), input, &tmp)) return (ast_free(ret), ERROR); if (tmp->kind == AST_PIPELINE) @@ -74,7 +76,7 @@ t_error build_sym_pipeline(t_parse_node self, t_const_str input, t_ast_node *out return (*out = ret, NO_ERROR); } -t_error build_sym_comment(t_parse_node self, t_const_str input, t_ast_node *out) +t_error build_sym_comment(t_parse_node self, t_const_str input, t_ast_node *out) { (void)(out); (void)(input); @@ -87,10 +89,11 @@ t_error build_sym_comment(t_parse_node self, t_const_str input, t_ast_node *out) return (NO_ERROR); } -t_error build_sym_variable_assignment(t_parse_node self, t_const_str input, t_ast_node *out) +t_error build_sym_variable_assignment(\ + t_parse_node self, t_const_str input, t_ast_node *out) { - t_ast_node ret; - t_parse_node temp_ast; + t_ast_node ret; + t_parse_node temp_ast; (void)(self); (void)(input); @@ -109,7 +112,8 @@ t_error build_sym_variable_assignment(t_parse_node self, t_const_str input, t_as } if (ts_node_child_count(self) > 2) { - if (ast_from_node(ts_node_child(self, 2), input, &ret->data.variable_assignment.value)) + if (ast_from_node(ts_node_child(\ + self, 2), input, &ret->data.variable_assignment.value)) return (ast_free(ret), ERROR); } return (*out = ret, NO_ERROR);