Commit e30771b2 authored by William Bundy's avatar William Bundy

rituals build 101

parent 48193bc2
git add --all
git commit -m "rituals build 100"
git commit -m "rituals build 101"
git push
git push github
99
1475270286.150386
100
1475270298.210691
......@@ -507,6 +507,118 @@ void parse_include_directive(Lexer* lex, Token* directive)
end_temp_arena(Temp_Arena);
}
void parse_tokens(Token* start)
{
Token* head = start;
do {
head = parse_dollarsign_instructions(head);
if(head->kind == Token_CompilerDirective && head->start[0] == 'i') {
parse_include_directive(&lex, head);
}
} while(head = head->next);
head = start;
do {
Token* next;
switch(head->kind) {
case Token_DollarSign:
head = parse_dollarsign_instructions(head);
break;
case Token_Ampersand:
next = head->next;
if(next && next->kind == Token_Ampersand) {
head->kind = Operator_LogicalAnd;
head->len++;
head->next = next->next;
}
break;
case Token_Pipe:
next = head->next;
if(next && next->kind == Token_Pipe) {
head->kind = Operator_LogicalOr;
head->len++;
head->next = next->next;
}
break;
case Token_Equals:
next = head->next;
if(next && next->kind == Token_Equals) {
head->kind = Operator_BooleanEquals;
head->len++;
head->next = next->next;
}
break;
case Token_ExclamationMark:
next = head->next;
if(next && next->kind == Token_Equals) {
head->kind = Operator_BooleanNotEquals;
head->len++;
head->next = next->next;
}
break;
case Token_GreaterThan:
next = head->next;
if(next && next->kind == Token_Equals) {
head->kind = Operator_BooleanGreaterEquals;
head->len++;
head->next = next->next;
}
break;
case Token_LessThan:
next = head->next;
if(next && next->kind == Token_Equals) {
head->kind = Operator_BooleanLessEquals;
head->len++;
head->next = next->next;
}
break;
case Token_Number:
parse_number_tokens(head);
break;
case Token_Minus:
next = head->next;
if(next && next->kind == Token_GreaterThan) {
head->kind = Operator_PtrMemberAccess;
head->len++;
head->next = next->next;
} else if(next && next->kind == Token_Minus) {
head->kind = Operator_Decrement;
head->len++;
head->next = next->next;
} else if(next && next->kind == Token_Number) {
Token_Kind prevkind = Token_Unknown;
if(head->prev != NULL) {
prevkind = head->prev->kind;
}
if(prevkind != Token_Number &&
prevkind != Token_Integer &&
prevkind != Token_Float &&
prevkind != Token_Identifier ) {
head->kind = Token_Number;
head->len += next->len;
head->next = next->next;
next = head->next;
parse_number_tokens(head);
}
}
break;
case Token_Plus:
next = head->next;
if(next && next->kind == Token_Plus) {
head->kind = Operator_Increment;
head->len++;
head->next = next->next;
}
default:
break;
}
} while(head = head->next);
}
struct Proc_Arg
{
......
......@@ -1207,7 +1207,7 @@ StructKind_Member src/metaprogram/metaprogram_parser.cpp /^ StructKind_Member$/;
StructKind_None src/metaprogram/metaprogram_parser.cpp /^ StructKind_None,$/;" e enum:Struct_Kind file:
StructKind_Struct src/metaprogram/metaprogram_parser.cpp /^ StructKind_Struct,$/;" e enum:Struct_Kind file:
StructKind_Union src/metaprogram/metaprogram_parser.cpp /^ StructKind_Union,$/;" e enum:Struct_Kind file:
StructMemberCapacity src/metaprogram/metaprogram_parser.cpp 755;" d file:
StructMemberCapacity src/metaprogram/metaprogram_parser.cpp 867;" d file:
Struct_Def src/metaprogram/metaprogram_parser.cpp /^struct Struct_Def$/;" s file:
Struct_Kind src/metaprogram/metaprogram_parser.cpp /^enum Struct_Kind$/;" g file:
Struct_Member src/metaprogram/metaprogram_parser.cpp /^typedef union Struct_Member Struct_Member;$/;" t typeref:union:Struct_Member file:
......@@ -2440,6 +2440,7 @@ parse_sing src/metaprogram/metaprogram_parser.cpp /^void parse_sing(Token* t, in
parse_spritefont_rectangles rituals_gui.cpp /^Rect* parse_spritefont_rectangles(char* glyphs_file, Memory_Arena* arena, int32 offsetx, int32 offsety, int32* w, int32* h)$/;" f
parse_spritefont_rectangles src/rituals_gui.cpp /^Rect2* parse_spritefont_rectangles(char* glyphs_file, Memory_Arena* arena, int32 offsetx, int32 offsety, int32* w, int32* h)$/;" f
parse_struct_member src/metaprogram/metaprogram_parser.cpp /^Token* parse_struct_member(Lexer* lex, Struct_Def* parent, Token* start, Memory_Arena* arena)$/;" f
parse_tokens src/metaprogram/metaprogram_parser.cpp /^void parse_tokens(Token* start)$/;" f
particles src/rituals_particles.cpp /^ Particle* particles;$/;" m struct:Emitter file:
particles_capacity src/rituals_particles.cpp /^ isize particles_count, particles_capacity;$/;" m struct:Emitter file:
particles_count src/rituals_particles.cpp /^ isize particles_count, particles_capacity;$/;" m struct:Emitter file:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment