frontend: debug: replace custom ast node printer with ast_node_to_string
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <blue/term.h>
|
||||
#include <blue/object/string.h>
|
||||
#include <ivy/asm/lex.h>
|
||||
#include <ivy/lang/ast.h>
|
||||
#include <ivy/lang/lex.h>
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user