feat: implement functions
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user