Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/modules/ROOT/pages/generators.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ When the symbol kind is `record` (e.g., `class`, `struct`, `union`), the symbol
| `string`
| The default access level of the record members (e.g., `public`, `private`).

| `isFinal`
| `bool`
| Whether the record is final.

| `isTypedef`
| `bool`
| Whether the record is a typedef.
Expand Down
1 change: 1 addition & 0 deletions include/mrdocs/Metadata/Info/Record.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ tag_invoke(
tag_invoke(t, io, dynamic_cast<Info const&>(I), domCorpus);
io.map("tag", I.KeyKind);
io.map("defaultAccess", getDefaultAccessString(I.KeyKind));
io.map("isFinal", I.IsFinal);
io.map("isTypedef", I.IsTypeDef);
io.map("bases", dom::LazyArray(I.Bases, domCorpus));
io.map("derived", dom::LazyArray(I.Derived, domCorpus));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{{~else~}}
{{>symbol/name-text symbol ~}}
{{~/if}}
{{~#if isFinal}} final{{/if~}}
{{#unless bases~}}
{{else if isFriend~}}
{{else}}
Expand All @@ -17,4 +18,11 @@
{{#unless (eq access ../defaultAccess)}} {{access}}{{/unless~}}
{{#if isVirtual}} virtual{{/if}} {{>type/declarator type~}}
{{/each~}}
{{/unless}}{{#isSeeBelow}} { /* see-below */ }{{/isSeeBelow}};
{{/unless}}
{{!-- Unless we are going to show a class body ("{ ... }"), don't add a
semicolon if the record is final, because something like `class A
final;` is ill-formed (`final` can't be used on a non-defining
declaration). Similarly, don't show a semicolon if there are base
classes. --}}
{{~#isSeeBelow}} { /* see-below */ }{{/isSeeBelow~}}
{{#if (or isSeeBelow (and (not isFinal) (eq (len bases) 0)))}};{{/if}}
10 changes: 10 additions & 0 deletions src/lib/Support/Handlebars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3793,6 +3793,16 @@ block_helper_missing_fn(
return {};
}

Expected<dom::Value>
is_empty_fn(dom::Array const& arguments)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait a minute... So this whole time, we were assuming this helper existed out of nowhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was an isEmpty() function but no corresponding registered helper.

Copy link
Collaborator

@alandefreitas alandefreitas Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. So all we need to fix is the category of the helper. It can't be built-in because this is a specific list determined by the specification, and isEmpty is not in it. It should be included in the container helpers. Please review the casing used for helper names in that section.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified that eq (len bases) 0 also works. Please tell me which solution you prefer.

{
if (arguments.size() != 2) {
return Unexpected(Error("isEmpty requires exactly one argument"));
}

return dom::Value(isEmpty(arguments.get(0)));
}

void
registerBuiltinHelpers(Handlebars& hbs)
{
Expand Down
6 changes: 3 additions & 3 deletions test-files/golden-tests/config/auto-relates/derived.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Declared in `&lt;derived&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct A
: link:#ABase[ABase];
: link:#ABase[ABase]
----

=== Base Classes
Expand Down Expand Up @@ -141,7 +141,7 @@ Declared in `&lt;derived&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct AView
: link:#ABase[ABase];
: link:#ABase[ABase]
----

=== Base Classes
Expand Down Expand Up @@ -194,7 +194,7 @@ Declared in `&lt;derived&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct AView2
: link:#AView[AView];
: link:#AView[AView]
----

=== Base Classes
Expand Down
6 changes: 3 additions & 3 deletions test-files/golden-tests/config/auto-relates/derived.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
struct A
: <a href="#ABase">ABase</a>;
: <a href="#ABase">ABase</a>
</code>
</pre>
</div>
Expand Down Expand Up @@ -172,7 +172,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
struct AView
: <a href="#ABase">ABase</a>;
: <a href="#ABase">ABase</a>
</code>
</pre>
</div>
Expand Down Expand Up @@ -241,7 +241,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
struct AView2
: <a href="#AView">AView</a>;
: <a href="#AView">AView</a>
</code>
</pre>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Declared in `&lt;base&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct A
: link:#B[B];
: link:#B[B]
----

=== Base Classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
struct A
: <a href="#B">B</a>;
: <a href="#B">B</a>
</code>
</pre>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Declared in `&lt;extract&hyphen;implicit&hyphen;specializations&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct A
: link:#B-00[B&lt;int&gt;];
: link:#B-00[B&lt;int&gt;]
----

=== Base Classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
struct A
: <a href="#B-00">B&lt;int&gt;</a>;
: <a href="#B-00">B&lt;int&gt;</a>
</code>
</pre>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Declared in `&lt;no&hyphen;extract&hyphen;implicit&hyphen;specializations&period
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct A
: link:#B[B&lt;int&gt;];
: link:#B[B&lt;int&gt;]
----

=== Base Classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
struct A
: <a href="#B">B&lt;int&gt;</a>;
: <a href="#B">B&lt;int&gt;</a>
</code>
</pre>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Declared in `&lt;base&hyphen;overload&hyphen;set&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Base
: public link:#ConstBase[ConstBase];
: public link:#ConstBase[ConstBase]
----

=== Base Classes
Expand Down Expand Up @@ -118,7 +118,7 @@ Declared in `&lt;base&hyphen;overload&hyphen;set&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class C
: public link:#Base[Base];
: public link:#Base[Base]
----

=== Base Classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
class Base
: public <a href="#ConstBase">ConstBase</a>;
: public <a href="#ConstBase">ConstBase</a>
</code>
</pre>
</div>
Expand Down Expand Up @@ -156,7 +156,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
class C
: public <a href="#Base">Base</a>;
: public <a href="#Base">Base</a>
</code>
</pre>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Declared in `&lt;copy&hyphen;dependencies&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class base
: public link:#base_base[base&lowbar;base];
: public link:#base_base[base&lowbar;base]
----

=== Base Classes
Expand Down Expand Up @@ -290,7 +290,7 @@ Declared in `&lt;copy&hyphen;dependencies&period;cpp&gt;`
----
class derived
: public link:#base[base]
, public excluded&lowbar;base;
, public excluded&lowbar;base
----

=== Base Classes
Expand Down Expand Up @@ -441,7 +441,7 @@ Declared in `&lt;copy&hyphen;dependencies&period;cpp&gt;`
----
class private&lowbar;derived
: link:#base[base]
, excluded&lowbar;base;
, excluded&lowbar;base
----

=== Member Functions
Expand Down Expand Up @@ -507,7 +507,7 @@ Declared in `&lt;copy&hyphen;dependencies&period;cpp&gt;`
----
class protected&lowbar;derived
: protected link:#base[base]
, protected excluded&lowbar;base;
, protected excluded&lowbar;base
----

=== Member Functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
class base
: public <a href="#base_base">base_base</a>;
: public <a href="#base_base">base_base</a>
</code>
</pre>
</div>
Expand Down Expand Up @@ -372,7 +372,7 @@ <h3>Synopsis</h3>
<code class="source-code cpp">
class derived
: public <a href="#base">base</a>
, public excluded_base;
, public excluded_base
</code>
</pre>
</div>
Expand Down Expand Up @@ -556,7 +556,7 @@ <h3>Synopsis</h3>
<code class="source-code cpp">
class private_derived
: <a href="#base">base</a>
, excluded_base;
, excluded_base
</code>
</pre>
</div>
Expand Down Expand Up @@ -642,7 +642,7 @@ <h3>Synopsis</h3>
<code class="source-code cpp">
class protected_derived
: protected <a href="#base">base</a>
, protected excluded_base;
, protected excluded_base
</code>
</pre>
</div>
Expand Down
8 changes: 4 additions & 4 deletions test-files/golden-tests/config/inherit-base-members/copy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Declared in `&lt;copy&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class base
: public link:#base_base[base&lowbar;base];
: public link:#base_base[base&lowbar;base]
----

=== Base Classes
Expand Down Expand Up @@ -328,7 +328,7 @@ Declared in `&lt;copy&period;cpp&gt;`
----
class derived
: public link:#base[base]
, public excluded&lowbar;base;
, public excluded&lowbar;base
----

=== Base Classes
Expand Down Expand Up @@ -612,7 +612,7 @@ Declared in `&lt;copy&period;cpp&gt;`
----
class private&lowbar;derived
: link:#base[base]
, excluded&lowbar;base;
, excluded&lowbar;base
----

=== Member Functions
Expand Down Expand Up @@ -678,7 +678,7 @@ Declared in `&lt;copy&period;cpp&gt;`
----
class protected&lowbar;derived
: protected link:#base[base]
, protected excluded&lowbar;base;
, protected excluded&lowbar;base
----

=== Member Functions
Expand Down
8 changes: 4 additions & 4 deletions test-files/golden-tests/config/inherit-base-members/copy.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h3>Synopsis</h3>
<pre>
<code class="source-code cpp">
class base
: public <a href="#base_base">base_base</a>;
: public <a href="#base_base">base_base</a>
</code>
</pre>
</div>
Expand Down Expand Up @@ -420,7 +420,7 @@ <h3>Synopsis</h3>
<code class="source-code cpp">
class derived
: public <a href="#base">base</a>
, public excluded_base;
, public excluded_base
</code>
</pre>
</div>
Expand Down Expand Up @@ -772,7 +772,7 @@ <h3>Synopsis</h3>
<code class="source-code cpp">
class private_derived
: <a href="#base">base</a>
, excluded_base;
, excluded_base
</code>
</pre>
</div>
Expand Down Expand Up @@ -858,7 +858,7 @@ <h3>Synopsis</h3>
<code class="source-code cpp">
class protected_derived
: protected <a href="#base">base</a>
, protected excluded_base;
, protected excluded_base
</code>
</pre>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Declared in `&lt;never&period;cpp&gt;`
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class base
: public link:#base_base[base&lowbar;base];
: public link:#base_base[base&lowbar;base]
----

=== Base Classes
Expand Down Expand Up @@ -286,7 +286,7 @@ Declared in `&lt;never&period;cpp&gt;`
----
class derived
: public link:#base[base]
, public excluded&lowbar;base;
, public excluded&lowbar;base
----

=== Base Classes
Expand Down Expand Up @@ -364,7 +364,7 @@ Declared in `&lt;never&period;cpp&gt;`
----
class private&lowbar;derived
: link:#base[base]
, excluded&lowbar;base;
, excluded&lowbar;base
----

=== Member Functions
Expand Down Expand Up @@ -430,7 +430,7 @@ Declared in `&lt;never&period;cpp&gt;`
----
class protected&lowbar;derived
: protected link:#base[base]
, protected excluded&lowbar;base;
, protected excluded&lowbar;base
----

=== Member Functions
Expand Down
Loading
Loading