aboutsummaryrefslogtreecommitdiff
path: root/src/docs_writer.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-01-24 23:28:59 +0000
committergingerBill <bill@gingerbill.org>2022-01-24 23:28:59 +0000
commitfe0b5bf4e27912c49f6c5eab817cbf514b0b22e4 (patch)
treef208f73ef6f9ae23c9a5ff548b8aa935e6de2ccf /src/docs_writer.cpp
parentf20105ddfee6d9a2aa02452e459c42c7f0310e76 (diff)
Parse comments on enums fields
Diffstat (limited to 'src/docs_writer.cpp')
-rw-r--r--src/docs_writer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/docs_writer.cpp b/src/docs_writer.cpp
index 825ca113f..b1b9450df 100644
--- a/src/docs_writer.cpp
+++ b/src/docs_writer.cpp
@@ -811,11 +811,12 @@ OdinDocEntityIndex odin_doc_add_entity(OdinDocWriter *w, Entity *e) {
comment = e->decl_info->comment;
docs = e->decl_info->docs;
}
- if (!comment && e->kind == Entity_Variable) {
- comment = e->Variable.comment;
- }
- if (!docs && e->kind == Entity_Variable) {
- docs = e->Variable.docs;
+ if (e->kind == Entity_Variable) {
+ if (!comment) { comment = e->Variable.comment; }
+ if (!docs) { docs = e->Variable.docs; }
+ } else if (e->kind == Entity_Constant) {
+ if (!comment) { comment = e->Constant.comment; }
+ if (!docs) { docs = e->Constant.docs; }
}
String link_name = {};