Files
ivy/lang/ast/double.c

20 lines
486 B
C
Raw Normal View History

#include "ctx.h"
#include "node.h"
2026-03-16 14:07:33 +00:00
#include <fx/ds/string.h>
2026-03-16 14:07:33 +00:00
static void to_string(struct ivy_ast_node *node, fx_string *str)
{
struct ivy_ast_double_node *v = (struct ivy_ast_double_node *)node;
2026-03-16 14:07:33 +00:00
fx_string_append_cstrf(
str, "%s (%.2lf)", ivy_ast_node_type_to_string(node->n_type),
v->n_value->t_double);
}
struct ast_node_type double_node_ops = {
.n_to_string = to_string,
.n_state_size = sizeof(struct parser_state),
.n_node_size = sizeof(struct ivy_ast_double_node),
};