diff options
| author | gingerBill <bill@gingerbill.org> | 2022-01-04 11:44:34 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-01-04 11:44:34 +0000 |
| commit | 17613185e79b324948c14257f64c388c8e2a52fb (patch) | |
| tree | 1cb7bee03645bea6168261f08041f0743eb7f352 /src/docs_writer.cpp | |
| parent | f15bb0b424d854e4ba84c14046b56d7b8357eb94 (diff) | |
Support struct field tags in odin doc format
Diffstat (limited to 'src/docs_writer.cpp')
| -rw-r--r-- | src/docs_writer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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<OdinDocString>(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: |