Improve docs_writer.cpp

This commit is contained in:
gingerBill
2022-01-17 22:17:07 +00:00
parent c7a9c8274f
commit fb01dfe048
5 changed files with 30 additions and 35 deletions
+1 -1
View File
@@ -513,7 +513,7 @@ OdinDocTypeIndex odin_doc_type(OdinDocWriter *w, Type *type) {
break;
case Type_Generic:
doc_type.kind = OdinDocType_Generic;
doc_type.name = odin_doc_write_string(w, type->Generic.name);
doc_type.name = odin_doc_write_string(w, type->Generic.entity->token.string);
if (type->Generic.specialized) {
doc_type.types = odin_doc_type_as_slice(w, type->Generic.specialized);
}
+5 -9
View File
@@ -3933,7 +3933,7 @@ gbString write_type_to_string(gbString str, Type *type) {
str = gb_string_appendc(str, " = ");
str = write_exact_value_to_string(str, var->Constant.value);
} else {
str = gb_string_appendc(str, "=");
str = gb_string_appendc(str, " := ");
str = write_exact_value_to_string(str, var->Constant.value);
}
continue;
@@ -3961,14 +3961,10 @@ gbString write_type_to_string(gbString str, Type *type) {
str = gb_string_appendc(str, "typeid/");
str = write_type_to_string(str, var->type);
} else {
if (var->kind == Entity_TypeName) {
str = gb_string_appendc(str, "$");
str = gb_string_append_length(str, name.text, name.len);
str = gb_string_appendc(str, "=");
str = write_type_to_string(str, var->type);
} else {
str = gb_string_appendc(str, "typeid");
}
str = gb_string_appendc(str, "$");
str = gb_string_append_length(str, name.text, name.len);
str = gb_string_appendc(str, "=");
str = write_type_to_string(str, var->type);
}
}
}