strip out collection type - instead we will implement collections via arrays of exprs which map to meta evals

This commit is contained in:
Ryan Fleury
2025-01-27 11:02:49 -08:00
parent c0f23c3807
commit b085acbc32
4 changed files with 7 additions and 20 deletions
-1
View File
@@ -71,7 +71,6 @@ E_TypeKindTable:
{IncompleteEnum "enum" 0 }
{Bitfield "bitfield" 0 }
{Variadic "variadic" 0 }
{Collection "collection" 0 }
}
@table(name op_kind precedence string op_pre op_sep op_pos)
+2 -4
View File
@@ -135,7 +135,7 @@ E_OpInfo e_expr_kind_op_info_table[49] =
{ E_OpKind_Binary, 13, str8_lit_comp(""), str8_lit_comp("="), str8_lit_comp("") },
};
U8 e_kind_basic_byte_size_table[56] =
U8 e_kind_basic_byte_size_table[55] =
{
0,
0,
@@ -192,10 +192,9 @@ U8 e_kind_basic_byte_size_table[56] =
0,
0,
0,
0,
};
String8 e_kind_basic_string_table[56] =
String8 e_kind_basic_string_table[55] =
{
str8_lit_comp(""),
str8_lit_comp("void"),
@@ -252,7 +251,6 @@ str8_lit_comp("class"),
str8_lit_comp("enum"),
str8_lit_comp("bitfield"),
str8_lit_comp("variadic"),
str8_lit_comp("collection"),
};
C_LINKAGE_END
+2 -3
View File
@@ -74,7 +74,6 @@ 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,
@@ -164,8 +163,8 @@ extern String8 e_token_kind_strings[6];
extern String8 e_expr_kind_strings[49];
extern String8 e_interpretation_code_display_strings[11];
extern E_OpInfo e_expr_kind_op_info_table[49];
extern U8 e_kind_basic_byte_size_table[56];
extern String8 e_kind_basic_string_table[56];
extern U8 e_kind_basic_byte_size_table[55];
extern String8 e_kind_basic_string_table[55];
C_LINKAGE_END
+3 -12
View File
@@ -2868,14 +2868,13 @@ rd_eval_space_write(void *u, E_Space space, void *in, Rng1U64 range)
Rng1U64 string_range = r1u64(string_off, string_opl);
if(contains_1u64(string_range, range.min))
{
String8 pre_edit_string = push_str8_copy(scratch.arena, str8(eval_blob.str + member->off, child->first->string.size));
String8 post_edit_string = ui_push_string_replace_range(scratch.arena, pre_edit_string, r1s64(range.min-string_range.min+1, range.max-string_range.min+1), str8_cstring_capped(in, (U8 *)in + dim_1u64(range)));
String8 new_string = str8_cstring_capped(in, (U8 *)in + dim_1u64(range));
if(child == &rd_nil_cfg)
{
child = rd_cfg_new(cfg, child_name);
}
rd_cfg_release_all_children(child);
rd_cfg_new(child, post_edit_string);
rd_cfg_new(child, new_string);
result = 1;
break;
}
@@ -9796,14 +9795,6 @@ rd_append_value_strings_from_eval(Arena *arena, EV_StringFlags flags, U32 defaul
space_taken += fnt_dim_from_tag_size_string(font, font_size, 0, 0, brace).x;
}
}break;
//- rjf: collections
case E_TypeKind_Collection:
{
String8 placeholder = str8_lit("{...}");
str8_list_push(arena, out, placeholder);
space_taken += fnt_dim_from_tag_size_string(font, font_size, 0, 0, placeholder).x;
}break;
}
scratch_end(scratch);
@@ -12924,7 +12915,7 @@ rd_frame(void)
E_TypeKey collection_type_keys[ArrayCount(rd_collection_name_table)] = {0};
for EachElement(idx, rd_collection_name_table)
{
collection_type_keys[idx] = e_type_key_cons(.kind = E_TypeKind_Collection, .name = rd_collection_name_table[idx]);
collection_type_keys[idx] = e_type_key_cons(.kind = E_TypeKind_Array, .name = rd_collection_name_table[idx]);
}
////////////////////////////