Skip to content

Commit

Permalink
tagfiles skip symbols with no anchors
Browse files Browse the repository at this point in the history
#fix
  • Loading branch information
alandefreitas committed Jan 2, 2025
1 parent b305f67 commit 78a28c3
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/lib/Lib/TagfileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "../Gen/xml/CXXTags.hpp"
#include "TagfileWriter.hpp"
#include "lib/Gen/hbs/VisitorHelpers.hpp"
#include "lib/Lib/ConfigImpl.hpp"
#include "lib/Support/RawOstream.hpp"

Expand Down Expand Up @@ -92,6 +93,14 @@ void
TagfileWriter::
operator()(T const& I)
{
if constexpr (std::derived_from<T, Info>)
{
if (!hbs::shouldGenerate(I))
{
return;
}
}

if constexpr (T::isNamespace())
{
// Namespaces are compound elements with members
Expand Down Expand Up @@ -119,12 +128,15 @@ writeNamespace(
bool onlyNamespaces = true;
corpus_->traverse(I, [&](Info const& I)
{
if (!hbs::shouldGenerate(I))
{
return;
}

if (I.Kind != InfoKind::Namespace)
{
onlyNamespaces = false;
return false;
}
return true;
});

// Write the compound element for this namespace
Expand All @@ -138,8 +150,13 @@ writeNamespace(
tags_.write("filename", generateFilename(I));

// Write the class-like members of this namespace
corpus_->traverse(I, [this]<typename U>(U const& J)
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
{
if (!hbs::shouldGenerate(J))
{
return;
}

if (!U::isNamespace() && !U::isFunction())
{
tags_.write(
Expand All @@ -150,7 +167,7 @@ writeNamespace(
});

// Write the function-like members of this namespace
corpus_->traverse(I, [this]<typename U>(U const& J)
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
{
if constexpr (U::isFunction())
{
Expand All @@ -162,7 +179,7 @@ writeNamespace(
}

// Write compound elements for the members of this namespace
corpus_->traverse(I, [this]<typename U>(U const& J)
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
{
this->operator()(J);
});
Expand All @@ -183,7 +200,7 @@ writeClassLike(
if constexpr (T::isRecord())
{
// Write the function-like members of this record
corpus_->traverse(I, [this]<typename U>(U const& J)
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
{
if constexpr (U::isFunction())
{
Expand Down

0 comments on commit 78a28c3

Please sign in to comment.