From 9e481d4f171a09bf2932a6139cc175fe7d00207d Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Thu, 27 Jun 2024 09:13:43 +0200 Subject: [PATCH] Print also the contents of tokens This makes debugging easier, though the output is harder to read --- ft_parse/ft_parse_tree_print.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ft_parse/ft_parse_tree_print.c b/ft_parse/ft_parse_tree_print.c index eab297d..bb46813 100644 --- a/ft_parse/ft_parse_tree_print.c +++ b/ft_parse/ft_parse_tree_print.c @@ -54,7 +54,7 @@ static void print_last_at_depth(t_parse_tree_node *node, ft_printf("%s\n", node); return ; } - ft_printf("%s-%s\n", branches, node->token.type); + ft_printf("%s-%s - %s\n", branches, node->token.type, node->token.str); branches[ft_strlen(branches) - 1] = ' '; ft_strlcat(branches, " |", MAX_WIDTH); print_children_at_depth(node, depth, branches); @@ -70,12 +70,12 @@ static void print_node_at_depth(t_parse_tree_node *node, } if (depth == 0) { - ft_printf("%s\n", node->token.type); + ft_printf("%s - %s\n", node->token.type, node->token.str); ft_strlcat(branches, "|", MAX_WIDTH); } else { - ft_printf("%s-%s\n", branches, node->token.type); + ft_printf("%s-%s - %s\n", branches, node->token.type, node->token.str); ft_strlcat(branches, " |", MAX_WIDTH); } print_children_at_depth(node, depth, branches); -- 2.30.2