From 7ed0c2288adca0b87f5fdda596cd14f408b77e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Fri, 6 Sep 2024 11:04:00 +0200 Subject: [PATCH] norming: adding ast/from_node to norm --- ast/src/_here_doc_not_done.c | 16 ++++++++++------ ast/src/from_node/from_node.c | 3 +-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ast/src/_here_doc_not_done.c b/ast/src/_here_doc_not_done.c index a7f54d6f..54d3bb80 100644 --- a/ast/src/_here_doc_not_done.c +++ b/ast/src/_here_doc_not_done.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/02 16:37:28 by rparodi #+# #+# */ -/* Updated: 2024/09/02 16:39:15 by rparodi ### ########.fr */ +/* Updated: 2024/09/06 10:53:13 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,19 +26,23 @@ t_error build_sym_heredoc_redirect(t_parse_node self, t_const_str input, \ t_ast_node ret; t_usize i; - if (ts_node_symbol(self) != sym_heredoc_redirect || input == NULL || out == NULL) + if (ts_node_symbol(self) != sym_heredoc_redirect || \ + input == NULL || out == NULL) return (ERROR); ret = ast_alloc(AST_HEREDOC_REDIRECTION); i = 0; while (i < ts_node_child_count(self)) { if (ts_node_field_id_for_child(self, i) == field_op) - ret->data.heredoc_redirection.op = _get_redirection_op(ts_node_child(self, i)); + ret->data.heredoc_redirection.op = \ + _get_redirection_op(ts_node_child(self, i)); else if (ts_node_symbol(ts_node_child(self, i)) == sym_heredoc_start) - ret->data.heredoc_redirection.delimiter = _extract_str(ts_node_child(self, i), input); + ret->data.heredoc_redirection.delimiter = \ + _extract_str(ts_node_child(self, i), input); else if (ts_node_symbol(ts_node_child(self, i)) == sym_heredoc_body) - ret->data.heredoc_redirection.content = _extract_str(ts_node_child(self, i), input); + ret->data.heredoc_redirection.content = \ + _extract_str(ts_node_child(self, i), input); i++; } return (*out = ret, NO_ERROR); -} \ No newline at end of file +} diff --git a/ast/src/from_node/from_node.c b/ast/src/from_node/from_node.c index 683f6735..ab84a6da 100644 --- a/ast/src/from_node/from_node.c +++ b/ast/src/from_node/from_node.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/26 10:55:52 by rparodi #+# #+# */ -/* Updated: 2024/09/03 15:48:47 by maiboyer ### ########.fr */ +/* Updated: 2024/09/06 11:02:57 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -141,7 +141,6 @@ t_error build_sym_list(t_parse_node self, t_const_str input, t_ast_node *out) return (*out = ret, NO_ERROR); } - t_error ast_from_node(\ t_parse_node node, t_const_str input, t_ast_node *out) {