New syntax that's easier to parse, parsing doesn't need variable lookup
This commit is contained in:
7
parser.c
7
parser.c
@@ -14,6 +14,7 @@ global Intern_String intern_void;
|
||||
global Intern_String intern_sizeu;
|
||||
|
||||
global Intern_String keyword_sizeof;
|
||||
global Intern_String keyword_cast;
|
||||
global Intern_String keyword_enum;
|
||||
global Intern_String keyword_typedef;
|
||||
global Intern_String keyword_struct;
|
||||
@@ -27,6 +28,7 @@ parser_init(Parser *p){
|
||||
p->interns = arena_push_array(&p->intern_table_arena, Intern_String, p->interns_count);
|
||||
|
||||
keyword_sizeof = intern_string(p, lit("sizeof"));
|
||||
keyword_cast = intern_string(p, lit("cast"));
|
||||
keyword_struct = intern_string(p, lit("struct"));
|
||||
keyword_enum = intern_string(p, lit("enum"));
|
||||
keyword_typedef = intern_string(p, lit("typedef"));
|
||||
@@ -36,7 +38,6 @@ parser_init(Parser *p){
|
||||
p->first_keyword = keyword_sizeof.s.str;
|
||||
p->last_keyword = keyword_global.s.str;
|
||||
|
||||
|
||||
intern_s64 = intern_string(p, lit("S64"));
|
||||
intern_s32 = intern_string(p, lit("S32"));
|
||||
intern_s16 = intern_string(p, lit("S16"));
|
||||
@@ -60,7 +61,6 @@ intern_is_keyword(Parser *p, Intern_String intern){
|
||||
|
||||
function void
|
||||
parser_push_error(Parser *p, Token *token, char *str, ...){
|
||||
|
||||
String string;
|
||||
{
|
||||
va_list args1, args2;
|
||||
@@ -80,6 +80,9 @@ parser_push_error(Parser *p, Token *token, char *str, ...){
|
||||
error->next = 0;
|
||||
error->token = token;
|
||||
SLLQueuePush(p->first_error, p->last_error, error);
|
||||
|
||||
__debugbreak();
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
function void
|
||||
|
||||
Reference in New Issue
Block a user