You can use compiler_interface hpp outside

This commit is contained in:
Krzosa Karol
2022-12-31 14:53:40 +01:00
parent 23db7cc5c4
commit e20edaa3a2
3 changed files with 32 additions and 3 deletions

View File

@@ -11,8 +11,8 @@ struct Ast_Lambda;
struct Ast_Type;
struct Ast_Expr;
#ifndef CORE_STRINGS
#define CORE_STRINGS
#ifndef CORE_BASE
#define CORE_BASE
struct String{
uint8_t *str;
int64_t len;
@@ -25,6 +25,33 @@ union Intern_String{ // Basically just String
int64_t len;
};
};
template<class T>
struct Array {
void *allocator;
T *data;
int64_t cap;
int64_t len;
};
template<class T>
struct List_Node{
List_Node<T> *next;
List_Node<T> *prev;
int cap;
int len;
T data[];
};
template<class T>
struct List{
int block_size = 0;
int allocation_multiplier = 0;
List_Node<T> *first = 0;
List_Node<T> *last = 0;
List_Node<T> *first_free = 0;
};
#endif
enum Token_Kind{