begin sketching out 'collections', which are the formal mechanism in the eval/eval-viz systems for visualizing synthetic structures/arrays/trees produced by the debugger, rather than ad-hocing / hardwiring the correct ev-block production for each kind of view - the views can still stay, but this is an important feature for other cases

This commit is contained in:
Ryan Fleury
2024-09-20 12:04:13 -07:00
parent bbd86449d8
commit 432e70caf6
10 changed files with 301 additions and 44 deletions
+1
View File
@@ -71,6 +71,7 @@ E_TypeKindTable:
{IncompleteEnum "enum" 0 }
{Bitfield "" 0 }
{Variadic "" 0 }
{Collection "" 0 }
}
@table(name op_kind precedence string op_pre op_sep op_pos)
+8 -4
View File
@@ -506,15 +506,18 @@ e_hash_from_type_key(E_TypeKey key)
str8_serial_push_struct(scratch.arena, &strings, &type->byte_size);
str8_serial_push_struct(scratch.arena, &strings, &type->count);
str8_serial_push_struct(scratch.arena, &strings, &type->off);
U64 direct_hash = e_hash_from_type_key(type->direct_type_key);
U64 owner_hash = e_hash_from_type_key(type->direct_type_key);
String8 direct_type_string = e_type_string_from_key(scratch.arena, type->direct_type_key);
String8 owner_type_string = e_type_string_from_key(scratch.arena, type->owner_type_key);
U64 direct_hash = e_hash_from_string(5381, direct_type_string);
U64 owner_hash = e_hash_from_string(5381, owner_type_string);
str8_serial_push_struct(scratch.arena, &strings, &direct_hash);
str8_serial_push_struct(scratch.arena, &strings, &owner_hash);
if(type->param_type_keys != 0)
{
for EachIndex(idx, type->count)
{
U64 param_type_hash = e_hash_from_type_key(type->param_type_keys[idx]);
String8 param_type_string = e_type_string_from_key(scratch.arena, type->param_type_keys[idx]);
U64 param_type_hash = e_hash_from_string(5381, param_type_string);
str8_serial_push_struct(scratch.arena, &strings, &param_type_hash);
}
}
@@ -522,7 +525,8 @@ e_hash_from_type_key(E_TypeKey key)
{
for EachIndex(idx, type->count)
{
U64 member_type_hash = e_hash_from_type_key(type->members[idx].type_key);
String8 member_type_string = e_type_string_from_key(scratch.arena, type->members[idx].type_key);
U64 member_type_hash = e_hash_from_string(5381, member_type_string);
str8_serial_push_struct(scratch.arena, &strings, &type->members[idx].off);
str8_serial_push_struct(scratch.arena, &strings, &member_type_hash);
}
+4 -2
View File
@@ -127,7 +127,7 @@ E_OpInfo e_expr_kind_op_info_table[45] =
{ E_OpKind_Binary, 13, str8_lit_comp(""), str8_lit_comp("="), str8_lit_comp("Define") },
};
U8 e_kind_basic_byte_size_table[55] =
U8 e_kind_basic_byte_size_table[56] =
{
0,
0,
@@ -184,9 +184,10 @@ U8 e_kind_basic_byte_size_table[55] =
0,
0,
0,
0,
};
String8 e_kind_basic_string_table[55] =
String8 e_kind_basic_string_table[56] =
{
str8_lit_comp(""),
str8_lit_comp("void"),
@@ -243,6 +244,7 @@ str8_lit_comp("class"),
str8_lit_comp("enum"),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
};
C_LINKAGE_END
+3 -2
View File
@@ -74,6 +74,7 @@ E_TypeKind_IncompleteClass,
E_TypeKind_IncompleteEnum,
E_TypeKind_Bitfield,
E_TypeKind_Variadic,
E_TypeKind_Collection,
E_TypeKind_COUNT,
E_TypeKind_FirstBasic = E_TypeKind_Void,
E_TypeKind_LastBasic = E_TypeKind_ComplexF128,
@@ -159,8 +160,8 @@ extern String8 e_token_kind_strings[6];
extern String8 e_expr_kind_strings[45];
extern String8 e_interpretation_code_display_strings[11];
extern E_OpInfo e_expr_kind_op_info_table[45];
extern U8 e_kind_basic_byte_size_table[55];
extern String8 e_kind_basic_string_table[55];
extern U8 e_kind_basic_byte_size_table[56];
extern String8 e_kind_basic_string_table[56];
C_LINKAGE_END