Files
ivy/lang/ast/atom.c

19 lines
481 B
C
Raw Normal View History

2024-12-06 13:46:41 +00:00
#include "ctx.h"
#include "node.h"
#include <blue/object/string.h>
2024-12-06 13:46:41 +00:00
static void to_string(struct ivy_ast_node *node, b_string *str)
2024-12-06 13:46:41 +00:00
{
struct ivy_ast_atom_node *v = (struct ivy_ast_atom_node *)node;
b_string_append_cstrf(str, "%s (%s)", ivy_ast_node_type_to_string(node->n_type),
2024-12-06 13:46:41 +00:00
v->n_content->t_str);
}
struct ast_node_type atom_node_ops = {
.n_to_string = to_string,
2024-12-06 13:46:41 +00:00
.n_state_size = sizeof(struct parser_state),
.n_node_size = sizeof(struct ivy_ast_atom_node),
};