@@ -68,12 +68,13 @@ void CompoundRecurse(YAML::Emitter& yaml, YamlContext const& ctx,
6868 for (auto const child : node) {
6969 if (!IncludeInPublicDocuments (ctx.config , child)) continue ;
7070 if (IgnoreForRecurse (child)) continue ;
71+ // Enums need to get their own files, so never recurse in them:
72+ if (kind (child) == " enum" ) continue ;
7173 if (AppendIfSectionDef (yaml, ctx, child)) continue ;
7274 if (AppendIfNamespace (yaml, ctx, child)) continue ;
7375 if (AppendIfClass (yaml, ctx, child)) continue ;
7476 if (AppendIfStruct (yaml, ctx, child)) continue ;
7577 if (AppendIfEnumValue (yaml, ctx, child)) continue ;
76- if (AppendIfEnum (yaml, ctx, child)) continue ;
7778 if (AppendIfTypedef (yaml, ctx, child)) continue ;
7879 if (AppendIfFriend (yaml, ctx, child)) continue ;
7980 if (AppendIfVariable (yaml, ctx, child)) continue ;
@@ -157,12 +158,12 @@ bool AppendIfEnumValue(YAML::Emitter& yaml, YamlContext const& ctx,
157158 auto const id = std::string_view{node.attribute (" id" ).as_string ()};
158159 auto const name = std::string_view{node.child (" name" ).child_value ()};
159160
160- yaml << YAML::BeginMap //
161- << YAML::Key << " uid" << YAML::Value << id //
162- << YAML::Key << " name" << YAML::Value << YAML::Literal << name //
163- << YAML::Key << " id" << YAML::Value << id //
164- << YAML::Key << " parent" << YAML::Value << ctx.parent_id //
165- << YAML::Key << " type" << YAML::Value << " enumvalue" //
161+ yaml << YAML::BeginMap //
162+ << YAML::Key << " uid" << YAML::Value << id //
163+ << YAML::Key << " name" << YAML::Value << name //
164+ << YAML::Key << " id" << YAML::Value << id //
165+ << YAML::Key << " parent" << YAML::Value << ctx.parent_id //
166+ << YAML::Key << " type" << YAML::Value << " enumvalue" //
166167 << YAML::Key << " langs" << YAML::BeginSeq << " cpp" << YAML::EndSeq;
167168 AppendDescription (yaml, node);
168169 yaml << YAML::EndMap;
@@ -179,7 +180,7 @@ bool AppendIfEnum(YAML::Emitter& yaml, YamlContext const& ctx,
179180 std::string_view{node.child (" qualifiedname" ).child_value ()};
180181 yaml << YAML::BeginMap //
181182 << YAML::Key << " uid" << YAML::Value << id //
182- << YAML::Key << " name" << YAML::Value << YAML::Literal << name //
183+ << YAML::Key << " name" << YAML::Value << name //
183184 << YAML::Key << " fullName" //
184185 << YAML::Value << YAML::Literal << full_name //
185186 << YAML::Key << " id" << YAML::Value << id //
@@ -188,6 +189,10 @@ bool AppendIfEnum(YAML::Emitter& yaml, YamlContext const& ctx,
188189 << YAML::Key << " langs" << YAML::BeginSeq << " cpp" << YAML::EndSeq; //
189190 AppendEnumSyntax (yaml, ctx, node);
190191 AppendDescription (yaml, node);
192+ auto const children = Children (ctx, node);
193+ if (!children.empty ()) {
194+ yaml << YAML::Key << " children" << YAML::Value << children;
195+ }
191196 yaml << YAML::EndMap;
192197 auto nested = ctx;
193198 nested.parent_id = id;
0 commit comments