2024-11-28 22:05:37 +00:00
|
|
|
#include "ctx.h"
|
|
|
|
|
#include "node.h"
|
|
|
|
|
|
2025-11-06 10:38:32 +00:00
|
|
|
#include <blue/ds/string.h>
|
2024-12-01 13:25:36 +00:00
|
|
|
|
2024-12-06 20:24:08 +00:00
|
|
|
static void to_string(struct ivy_ast_node *node, b_string *str)
|
2024-11-28 22:05:37 +00:00
|
|
|
{
|
|
|
|
|
struct ivy_ast_ident_node *ident = (struct ivy_ast_ident_node *)node;
|
|
|
|
|
|
2025-11-06 10:38:32 +00:00
|
|
|
b_string_append_cstrf(
|
|
|
|
|
str, "%s (%s)", ivy_ast_node_type_to_string(node->n_type),
|
|
|
|
|
ident->n_content->t_str);
|
2024-11-28 22:05:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ast_node_type ident_node_ops = {
|
2024-12-06 20:24:08 +00:00
|
|
|
.n_to_string = to_string,
|
2024-11-29 12:06:06 +00:00
|
|
|
.n_state_size = sizeof(struct parser_state),
|
|
|
|
|
.n_node_size = sizeof(struct ivy_ast_ident_node),
|
2024-11-28 22:05:37 +00:00
|
|
|
};
|