feat: implement functions

This commit is contained in:
samsonium
2026-10-15 02:23:43 +03:00
parent cc3087296f
commit 2c206822ca
15 changed files with 391 additions and 36 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
#include <compiler/utils/fzl_symtable.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -20,7 +21,7 @@ fzl_symtable_t *fzl_mksymt()
}
fzl_symtable_res_t fzl_symt_put(fzl_symtable_t *symt, char *name,
fzl_type_t type)
fzl_type_t type, uint64_t ip)
{
if (!symt)
return FZL_SYMTABLE_RESULT_ERR;
@@ -35,7 +36,8 @@ fzl_symtable_res_t fzl_symt_put(fzl_symtable_t *symt, char *name,
symt->symbols = realloc(symt->symbols, symt->remainder * sizeof(fzl_sym_t));
}
symt->symbols[symt->size++] = (fzl_sym_t){.name = name, .type = type};
symt->symbols[symt->size++] =
(fzl_sym_t){.name = name, .type = type, .ip = ip};
return FZL_SYMTABLE_RESULT_OK;
}