Started work on AST printing (as shell acceptable stuff)

This commit is contained in:
Maix0 2024-07-03 22:07:06 +02:00
parent 4a0a5fbb8d
commit d2a59f770e
4 changed files with 416 additions and 14 deletions

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/28 14:40:38 by rparodi #+# #+# */
/* Updated: 2024/07/03 18:46:59 by maiboyer ### ########.fr */
/* Updated: 2024/07/03 21:23:17 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -28,6 +28,7 @@
#include "ast/ast.h"
t_error ast_from_node(t_parse_node node, t_str input, t_ast_node *out);
void ast_print_node(t_ast_node self);
// Foutre envp dans env
// Chaque elemenet d'envp split au premier =
@ -103,7 +104,7 @@ t_node parse_to_nodes(t_first_parser *parser, t_const_str input)
if (ast_from_node(node, (t_str)input, &out))
printf("Error when building node\n");
else
ast_free(out);
(ast_print_node(out), printf("\n"), ast_free(out));
ret = build_node(node, input);
ts_tree_delete(tree);
return (ret);