From 175e191aa67d17f2ff556e70dc7d4ca1505a49b8 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Fri, 6 Dec 2024 20:24:33 +0000 Subject: [PATCH] frontend: debug: replace custom ast node printer with ast_node_to_string --- frontend/debug.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/debug.c b/frontend/debug.c index 61ccc53..b572431 100644 --- a/frontend/debug.c +++ b/frontend/debug.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -179,6 +180,12 @@ extern enum ivy_status print_ast_node( break; } + b_string *str = b_string_create(); + ivy_ast_node_to_string(node, str); + b_printf("%s", b_string_ptr(str)); + b_string_release(str); + +#if 0 b_puts(ivy_ast_node_type_to_string(node->n_type)); switch (node->n_type) { @@ -327,6 +334,7 @@ extern enum ivy_status print_ast_node( default: break; } +#endif #if 0 switch (tok->t_type) { case IVY_TOK_IDENT: