19 lines
493 B
C
19 lines
493 B
C
#include "ctx.h"
|
|
#include "node.h"
|
|
|
|
#include <blue/object/string.h>
|
|
|
|
static void to_string(struct ivy_ast_node *node, b_string *str)
|
|
{
|
|
struct ivy_ast_ident_node *ident = (struct ivy_ast_ident_node *)node;
|
|
|
|
b_string_append_cstrf(str, "%s (%s)", ivy_ast_node_type_to_string(node->n_type),
|
|
ident->n_content->t_str);
|
|
}
|
|
|
|
struct ast_node_type ident_node_ops = {
|
|
.n_to_string = to_string,
|
|
.n_state_size = sizeof(struct parser_state),
|
|
.n_node_size = sizeof(struct ivy_ast_ident_node),
|
|
};
|