#include "../debug.h" #include "codegen.h" #include #include #include struct fstring_codegen_state { struct code_generator_state s_base; struct mie_value *s_stringbuilder; }; static struct code_generator_result gen_fstring( struct ivy_codegen *gen, struct code_generator_state *state, struct ivy_ast_node *node, size_t depth) { struct fstring_codegen_state *fstring = (struct fstring_codegen_state *)state; return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED); } static struct code_generator_result gen_expr( struct ivy_codegen *gen, struct code_generator_state *state, struct ivy_ast_node *node, size_t depth) { codegen_push_generator(gen, CODE_GENERATOR_EXPR, 0, NULL); return CODEGEN_RESULT_OK(CODEGEN_R_REPEAT_NODE); } static enum ivy_status state_init( struct ivy_codegen *gen, struct code_generator_state *state, uintptr_t argv, void *argp) { debug_printf("codegen: start of fstring\n"); return IVY_OK; } static enum ivy_status state_fini( struct ivy_codegen *gen, struct code_generator_state *state, struct code_generator_value *result) { debug_printf("codegen: end of fstring\n"); struct fstring_codegen_state *fstring = (struct fstring_codegen_state *)state; return IVY_ERR_NOT_SUPPORTED; } static struct code_generator_result value_received( struct ivy_codegen *gen, struct code_generator_state *state, struct code_generator_value *value) { struct fstring_codegen_state *fstring = (struct fstring_codegen_state *)state; return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED); } struct code_generator fstring_generator = { .g_type = CODE_GENERATOR_FSTRING, .g_state_size = sizeof(struct fstring_codegen_state), .g_state_init = state_init, .g_state_fini = state_fini, .g_value_received = value_received, .g_expr_generator = gen_expr, .g_node_generators = { NODE_CODEGEN(FSTRING, gen_fstring), }, };