wip: working on generator

- Feat: add typedefs' branches
This commit is contained in:
samsonium
2026-11-04 19:33:17 +03:00
parent 731b662cfc
commit 7fe3fe3ff3
7 changed files with 228 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
#include <common/fzl_extern.h>
#include <compiler/fzl_token.h>
#include <compiler/internals/gen.h>
#include <stdbool.h>
#include <stdio.h>
// Type reference (convert T => T*)
bool gen_reference(fzl_gen_t *gen, fzl_node_t *node)
{
if (!gen || !node)
return false;
char *refname = (char *)node->token->value;
ssize_t slot = gen_resolve_extern_type(gen, refname);
if (slot == -1)
return false;
type_buf.kind = FZL_EXTERN_KIND_REF;
type_buf.ref_target =
(fzl_extern_type_ref_t){.is_primitive = false, .type_slot = slot};
return true;
}