Improve doc-writer format for #all_or_none

This commit is contained in:
gingerBill
2025-11-05 13:42:19 +00:00
parent c5556aa2e0
commit c937d38db2
2 changed files with 64 additions and 3 deletions

View File

@@ -622,6 +622,12 @@ gb_internal OdinDocTypeIndex odin_doc_type(OdinDocWriter *w, Type *type, bool ca
if (type->Struct.is_raw_union) { doc_type.flags |= OdinDocTypeFlag_Struct_raw_union; }
if (type->Struct.is_all_or_none) { doc_type.flags |= OdinDocTypeFlag_Struct_all_or_none; }
if (type->Struct.custom_min_field_align > 0 || type->Struct.custom_max_field_align > 0) {
doc_type.elem_count_len = 2;
doc_type.elem_counts[0] = cast(u32)gb_max(type->Struct.custom_min_field_align, 0);
doc_type.elem_counts[1] = cast(u32)gb_max(type->Struct.custom_max_field_align, 0);
}
auto fields = array_make<OdinDocEntityIndex>(heap_allocator(), type->Struct.fields.count);
defer (array_free(&fields));