diff options
| author | gingerBill <bill@gingerbill.org> | 2021-10-27 23:26:17 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-10-27 23:26:17 +0100 |
| commit | ccab715bbc3153e2fb832b1d5b2bc061d8900da6 (patch) | |
| tree | ca6fe5aa0df119a1c8baf7799ce43d9593ada428 /src | |
| parent | c4d2aae0ed55d972b0074031ac82db6f9546447e (diff) | |
Add support for matrix type in doc format
Diffstat (limited to 'src')
| -rw-r--r-- | src/docs_format.cpp | 1 | ||||
| -rw-r--r-- | src/docs_writer.cpp | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/docs_format.cpp b/src/docs_format.cpp index ee9842534..98ac13c8b 100644 --- a/src/docs_format.cpp +++ b/src/docs_format.cpp @@ -82,6 +82,7 @@ enum OdinDocTypeKind : u32 { OdinDocType_RelativePointer = 20, OdinDocType_RelativeSlice = 21, OdinDocType_MultiPointer = 22, + OdinDocType_Matrix = 23, }; enum OdinDocTypeFlag_Basic : u32 { diff --git a/src/docs_writer.cpp b/src/docs_writer.cpp index 451c44c4e..25aa68167 100644 --- a/src/docs_writer.cpp +++ b/src/docs_writer.cpp @@ -756,6 +756,14 @@ OdinDocTypeIndex odin_doc_type(OdinDocWriter *w, Type *type) { doc_type.types = odin_write_slice(w, types, gb_count_of(types)); } break; + + case Type_Matrix: + doc_type.kind = OdinDocType_Matrix; + doc_type.elem_count_len = 2; + doc_type.elem_counts[0] = type->Matrix.row_count; + doc_type.elem_counts[1] = type->Matrix.column_count; + doc_type.types = odin_doc_type_as_slice(w, type->Matrix.elem); + break; } if (dst) { |