lang: ast: misc formatting and reference fixes

This commit is contained in:
2024-12-06 21:33:53 +00:00
parent bd377b00f4
commit 67bfdef18a
4 changed files with 70 additions and 36 deletions

View File

@@ -1,5 +1,6 @@
#include "node.h"
#include <blue/object/string.h>
#include <ivy/lang/ast.h>
#include <stdio.h>
#include <stdlib.h>
@@ -192,7 +193,6 @@ struct ivy_ast_node *ast_node_create(enum ivy_ast_node_type type)
return node;
}
void ivy_ast_node_to_string(struct ivy_ast_node *node, struct b_string *out)
{
const struct ast_node_type *type_info = get_ast_node_type(node->n_type);
@@ -203,7 +203,8 @@ void ivy_ast_node_to_string(struct ivy_ast_node *node, struct b_string *out)
if (type_info->n_to_string) {
type_info->n_to_string(node, out);
} else {
b_string_append_cstr(out, ivy_ast_node_type_to_string(node->n_type));
b_string_append_cstr(
out, ivy_ast_node_type_to_string(node->n_type));
}
}