Complete rework, adding packages

This commit is contained in:
Krzosa Karol
2022-06-09 21:30:52 +02:00
parent 4edd2a4799
commit fbe911d267
11 changed files with 399 additions and 497 deletions

View File

@@ -5,7 +5,7 @@
struct Token;
Allocator *bigint_allocator;
global S64 bigint_allocation_count;
function void parsing_error(Token *token, const char *str, ...);
function void compiler_error(Token *token, const char *str, ...);
#define Set_BigInt_Allocator(x) BigInt_Allocator bigint_allocator(x)
struct BigInt_Allocator{
@@ -17,7 +17,7 @@ struct BigInt_Allocator{
#define count_bigint_alloc() (bigint_allocator != thread_ctx.scratch ? bigint_allocation_count++ : 0)
#define malloc_arena(x) (count_bigint_alloc(), exp_alloc(bigint_allocator, x, AF_ZeroMemory))
#define ALLOC_DIGITS(_digits) (uint64_t *)((_digits) ? malloc_arena(sizeof(uint64_t) * (_digits)) : NULL)
#define FATAL_ERROR(x) parsing_error(0, x)
#define FATAL_ERROR(x) compiler_error(0, x)
struct BigInt
{