Cleanup iterators, remove logging, add message queue

This commit is contained in:
Krzosa Karol
2023-01-01 19:18:42 +01:00
parent 3de813212a
commit ec66f02e46
8 changed files with 214 additions and 217 deletions

View File

@@ -26,14 +26,7 @@ struct String{
uint8_t *str;
int64_t len;
};
union Intern_String{ // Basically just String
String s;
struct{
uint8_t *str;
int64_t len;
};
};
typedef String Intern_String;
template<class T>
struct Array {
@@ -612,9 +605,9 @@ struct Ast_Decl: Ast{
Ast_Lambda *lambda;
};
/*#import meta
meta.inline_value_fields()
*/
/*#import meta
meta.inline_value_fields()
*/
union {
Value value;
struct {
@@ -632,10 +625,30 @@ struct Ast_Decl: Ast{
/*END*/
};
/*
Array<Token> lex_file(Allocator *allocator, char *filename);
Array<Token> lex_string(Allocator *allocator, char *string, size_t size);
enum Core_Message_Kind {
CORE_ERROR,
CORE_WARNING,
CORE_TRACE,
};
struct Core_Message {
Core_Message *next;
Core_Message_Kind kind;
String string;
Token *pos1;
Token *pos2;
int trace_line;
char *trace_file;
};
/*
Array<Token> core_lex_file(Allocator *allocator, char *filename);
Array<Token> core_lex_string(Allocator *allocator, char *string, size_t size);
Core_Context *core_create_context(Allocator *allocator);
Array<Token> core_lex_string(Core_Context *ctx, char *string, size_t size);
*/