ref: add type/classname result for each gen_* function

This commit is contained in:
samsonium
2026-11-04 22:25:25 +03:00
parent b278e8bb74
commit aae183c0c0
15 changed files with 204 additions and 108 deletions
+8 -5
View File
@@ -1,18 +1,21 @@
#include <common/fzl_types.h>
#include <compiler/internals/gen.h>
#include <stdbool.h>
#include <stdio.h>
// Format string
bool gen_fmtstr(fzl_gen_t *gen, fzl_node_t *node)
gen_res_t gen_fmtstr(fzl_gen_t *gen, fzl_node_t *node)
{
if (!gen || !node)
return false;
return (gen_res_t){.error = true};
for (size_t i = 0; i < node->list.entry_count; i++)
if (!gen_common(gen, node->list.entries[i]))
return false;
if (gen_common(gen, node->list.entries[i]).error)
return (gen_res_t){.error = true};
gen_op(gen, FZL_OPCODE_BUILD_STR);
gen_word(gen, node->list.entry_count);
return true;
return (gen_res_t){
.error = false, .type = FZL_TYPE_STRING, .classname = NULL};
}