diff --git a/core/odin/doc-format/doc_format.odin b/core/odin/doc-format/doc_format.odin index c80be2489..83cd89ca2 100644 --- a/core/odin/doc-format/doc_format.odin +++ b/core/odin/doc-format/doc_format.odin @@ -11,7 +11,7 @@ String :: distinct Array(byte) Version_Type_Major :: 0 Version_Type_Minor :: 2 -Version_Type_Patch :: 1 +Version_Type_Patch :: 2 Version_Type :: struct { major, minor, patch: u8, @@ -242,6 +242,8 @@ Type :: struct { polymorphic_params: Type_Index, // Used By: .Struct, .Union where_clauses: Array(String), + // Used By: .Struct + tags: Array(String), } Type_Flags_Basic :: distinct bit_set[Type_Flag_Basic; u32le] diff --git a/src/docs_format.cpp b/src/docs_format.cpp index 1c3af6257..5cfac4817 100644 --- a/src/docs_format.cpp +++ b/src/docs_format.cpp @@ -15,7 +15,7 @@ struct OdinDocVersionType { #define OdinDocVersionType_Major 0 #define OdinDocVersionType_Minor 2 -#define OdinDocVersionType_Patch 1 +#define OdinDocVersionType_Patch 2 struct OdinDocHeaderBase { u8 magic[8]; @@ -137,6 +137,7 @@ struct OdinDocType { OdinDocArray entities; OdinDocTypeIndex polmorphic_params; OdinDocArray where_clauses; + OdinDocArray tags; // struct field tags }; struct OdinDocAttribute { diff --git a/src/docs_writer.cpp b/src/docs_writer.cpp index e8e8892ec..56ad0561e 100644 --- a/src/docs_writer.cpp +++ b/src/docs_writer.cpp @@ -598,6 +598,15 @@ OdinDocTypeIndex odin_doc_type(OdinDocWriter *w, Type *type) { } doc_type.where_clauses = odin_doc_where_clauses(w, st->where_clauses); } + + auto tags = array_make(heap_allocator(), type->Struct.fields.count); + defer (array_free(&tags)); + + for_array(i, type->Struct.fields) { + tags[i] = odin_doc_write_string(w, type->Struct.tags[i]); + } + + doc_type.tags = odin_write_slice(w, tags.data, tags.count); } break; case Type_Union: