New approach, new lexer
This commit is contained in:
20
lang.h
20
lang.h
@@ -4,7 +4,7 @@
|
||||
#define function static
|
||||
|
||||
#define assert(x) do{if(!(x)) __debugbreak();}while(0)
|
||||
#define assert_msg(x,msg) assert(x)
|
||||
#define assert_msg(x,...) assert(x)
|
||||
#define not_implemented assert_msg(0, "Not implemented")
|
||||
#define invalid_codepath assert_msg(0, "Invalid codepath")
|
||||
|
||||
@@ -35,12 +35,30 @@ const B32 false = 0;
|
||||
#define kib(x) ((x)*1024llu)
|
||||
#define mib(x) (kib(x)*1024llu)
|
||||
#define gib(x) (mib(x)*1024llu)
|
||||
#define string_expand(x) (int)x.len, x.str
|
||||
|
||||
typedef struct String_Node String_Node;
|
||||
typedef struct String_List String_List;
|
||||
typedef struct String{
|
||||
U8 *str;
|
||||
S64 len;
|
||||
}String;
|
||||
|
||||
struct String_Node{
|
||||
String_Node *next;
|
||||
union{
|
||||
String string;
|
||||
struct{U8*str; S64 len;};
|
||||
};
|
||||
};
|
||||
|
||||
struct String_List{
|
||||
String_Node *first;
|
||||
String_Node *last;
|
||||
S64 char_count;
|
||||
S64 node_count;
|
||||
};
|
||||
|
||||
#define SLLQueuePushMod(f,l,n,next) do{\
|
||||
if((f)==0){\
|
||||
(f)=(l)=(n);\
|
||||
|
||||
Reference in New Issue
Block a user