expose symbols table errors in the header

This commit is contained in:
omicron 2025-04-08 21:57:28 +02:00
parent 347512e599
commit 8c62924b63
2 changed files with 7 additions and 3 deletions

View File

@ -7,11 +7,11 @@
constexpr size_t symbol_table_default_cap = 64;
constexpr size_t symbol_table_max_cap = 1 << 16;
error_t *err_symbol_table_invalid_node = &(error_t){
error_t *const err_symbol_table_invalid_node = &(error_t){
.message = "Unexpected node id when adding symbol to symbol table"};
error_t *err_symbol_table_max_cap = &(error_t){
error_t *const err_symbol_table_max_cap = &(error_t){
.message = "Failed to increase symbol table length, max capacity reached"};
error_t *err_symbol_table_incompatible_symbols =
error_t *const err_symbol_table_incompatible_symbols =
&(error_t){.message = "Failed to update symbol with incompatible kind"};
error_t *symbol_table_alloc(symbol_table_t **output) {

View File

@ -3,6 +3,10 @@
#include "../ast.h"
extern error_t *const err_symbol_table_invalid_node;
extern error_t *const err_symbol_table_max_cap;
extern error_t *const err_symbol_table_incompatible_symbols;
typedef enum symbol_kind {
SYMBOL_REFERENCE,
SYMBOL_LOCAL,