Commit d4813421 authored by William Bundy's avatar William Bundy

rituals build 115

parent 002a0a48
git add --all
git commit -m "rituals build 114"
git commit -m "rituals build 115"
git push
git push github
113
1475271764.630578
114
1475271818.007641
......@@ -91,27 +91,10 @@ Memory_Arena* Work_Arena;
Memory_Arena* Temp_Arena;
union MyUnion
struct foobar
{
struct {
real x, y, z, w;
};
struct {
uint32 aa, bb, cc, dd;
};
struct {
char* p, *q, *r, *s;
};
int **v[32];
};
void foo()
{
MyUnion u;
u.x = 44;
printf("%d \n", u.aa);
u.s = (char*)"Hello, world!";
}
char* load_file(char* filename, isize* size_out, Memory_Arena* arena)
......@@ -183,12 +166,14 @@ int main(int argc, char** argv)
fprintf(stderr, "Found %d procedures, %d structs \n",
lex.procedures_count, lex.structs_count);
//Print struct typedefs
Struct_Def* s_head = structdef;
do {
if(s_head->name == NULL) continue;
printf("typedef struct %s %s;\n", s_head->name, s_head->name);
} while(s_head = s_head->next);
//Print Meta_Types for structs
Struct_Def** all_structs = arena_push_array(Work_Arena,
Struct_Def*, lex.structs_count + 16);
......@@ -206,11 +191,15 @@ int main(int argc, char** argv)
} while(s_head = s_head->next);
printf("};\n");
// Print structs
s_head = structdef;
do {
if(s_head->name == NULL) continue;
print_struct(s_head);
} while(s_head = s_head->next);
// Print metadata
#if 1
do {
......
......@@ -952,7 +952,6 @@ void print_struct_names(Struct_Def* def, isize index, char* prefix, isize prefix
local_struct[0] = def;
def->meta_index = local_counter;
*counter = local_counter + 1;
fprintf(stderr, "%d %s\n", *counter, def->name);
if(index == -1) {
chars = printf("\t%.*s_%s,\n", prefix_len, prefix, def->name);
} else {
......@@ -992,8 +991,6 @@ void print_struct_names(Struct_Def* def, isize index, char* prefix, isize prefix
}
}
isize subcount = 0;
for(isize i = 0; i < def->member_count; ++i) {
if(def->member_kinds[i] != StructKind_Member) {
......@@ -1326,53 +1323,15 @@ Struct_Def* find_struct_defs(Lexer* lex, Token* start, Memory_Arena* arena)
*
*/
/*
struct Meta_Member_Definition
struct Meta_Member
{
uint64 flags;
Meta_Type type;
uint32 pointer_depth;
char* name;
isize offset;
};
Meta_Member_Definition MembersOf_Rect2[] = {
{
0, "x", (isize)&((Rect2*)NULL)->x
},
{
}
};
struct Meta_Type
{
uint64 offset;
};
Meta_Type Reflected_Types[...] = {
Meta_Type{
"Point",
3,
},
}
Meta_Type_Member Reflected_Type_Members[][] = {
}
/*
* Entity_Meta->
*
*
*
*
*/
void print_reflection_data(Struct_Def* def)
{
//print meta type declaration
......
This diff is collapsed.
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