Skip to content

Commit 055fac3

Browse files
sdkrystianalandefreitas
authored andcommitted
chore: adoc generator improvements
1 parent d921878 commit 055fac3

22 files changed

+162
-156
lines changed
Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
{{#if (eq kind "lvalue-reference")~}}
2-
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}){{~/if~}}
1+
{{#if pointee-type~}}
2+
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))}}){{/if~}}
33
{{~>declarator-after pointee-type~}}
4-
{{~else if (eq kind "rvalue-reference")~}}
5-
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}){{~/if~}}
6-
{{~>declarator-after pointee-type~}}
7-
{{~else if (eq kind "pointer")~}}
8-
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}){{~/if~}}
9-
{{~>declarator-after pointee-type~}}
10-
{{~else if (eq kind "member-pointer")~}}
11-
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}){{~/if~}}
12-
{{~>declarator-after pointee-type~}}
13-
{{~else if (eq kind "pack")~}}
4+
{{else if (eq kind "pack")~}}
145
{{~>declarator-after pattern-type~}}
15-
{{~else if (eq kind "array")~}}
6+
{{else if (eq kind "array")~}}
167
[{{bounds-value}}]
178
{{~>declarator-after element-type~}}
18-
{{~else if (eq kind "function")~}}
19-
({{~#each param-types~}}
20-
{{~>declarator decl-name="" decl-name-targs=""~}}{{~#unless @last}}, {{/unless~}}
21-
{{~/each~}})
9+
{{else if (eq kind "function")~}}
10+
({{#each param-types~}}
11+
{{~>declarator~}}{{~#unless @last}}, {{/unless~}}
12+
{{/each~}})
2213
{{~#if cv-qualifiers}} {{cv-qualifiers}}{{/if~}}
23-
{{~#if (eq ref-qualifier "lvalue")}} &{{else if (eq ref-qualifier "rvalue")}} &&{{/if~}}
24-
{{~#if exception-spec}} {{exception-spec}}{{~/if~}}
14+
{{#if (eq ref-qualifier "lvalue")}} &{{else if (eq ref-qualifier "rvalue")}} &&{{/if~}}
15+
{{#if exception-spec}} {{exception-spec}}{{/if~}}
2516
{{~>declarator-after return-type~}}
26-
{{/if}}
17+
{{/if}}
Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
1-
{{#if (eq kind "builtin")~}}
2-
{{#if cv-qualifiers}}{{cv-qualifiers}} {{/if~}}
3-
{{name~}}
4-
{{~else if (eq kind "tag")~}}
5-
{{#if cv-qualifiers}}{{cv-qualifiers}} {{/if~}}
6-
{{#if parent-type~}}{{>declarator parent-type decl-name="" decl-name-targs=""}}::{{/if~}}
7-
{{#if id}}{{>xref .}}[{{name~}}]{{else}}{{name~}}{{/if}}
8-
{{~else if (eq kind "specialization")~}}
9-
{{#if cv-qualifiers}}{{cv-qualifiers}} {{/if~}}
10-
{{#if parent-type~}}{{>declarator parent-type decl-name="" decl-name-targs=""}}::{{/if~}}
11-
{{#if id}}{{>xref .}}[{{name~}}]{{else}}{{name~}}{{/if}}
12-
{{~>template-args args=template-args~}}
13-
{{~else if (eq kind "lvalue-reference")~}}
1+
{{#if pointee-type~}}
142
{{~>declarator-before pointee-type~}}
15-
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}({{~/if~}}&
16-
{{~else if (eq kind "rvalue-reference")~}}
17-
{{~>declarator-before pointee-type~}}
18-
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}({{~/if~}}&&
19-
{{~else if (eq kind "pointer")~}}
20-
{{~>declarator-before pointee-type~}}
21-
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}({{~/if~}}*
22-
{{~#if cv-qualifiers}} {{cv-qualifiers}}{{/if~}}
23-
{{~else if (eq kind "member-pointer")~}}
24-
{{~>declarator-before pointee-type~}}
25-
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}({{~/if~}}
26-
{{#if parent-type~}}{{>declarator parent-type decl-name="" decl-name-targs=""}}::*{{/if~}}
27-
{{#if cv-qualifiers}} {{cv-qualifiers}}{{/if~}}
28-
{{~else if (eq kind "pack")~}}
29-
{{~>declarator-before pattern-type~}}...
30-
{{~else if (eq kind "array")~}}
3+
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))}}({{/if~}}
4+
{{else if element-type~}}
315
{{~>declarator-before element-type~}}
32-
{{~else if (eq kind "function")~}}
6+
{{else if return-type~}}
337
{{~>declarator-before return-type~}}
34-
{{/if}}
8+
{{else if pattern-type~}}
9+
{{~>declarator-before pattern-type}}...
10+
{{~/if~}}
11+
{{#if parent-type~}}
12+
{{#if parent-type}}{{>declarator parent-type}}::{{/if~}}
13+
{{/if~}}
14+
{{#if (eq kind "lvalue-reference")}}&{{/if~}}
15+
{{#if (eq kind "rvalue-reference")}}&&{{/if~}}
16+
{{#if (eq kind "pointer")}}*{{/if~}}
17+
{{#if (eq kind "member-pointer")}}*{{/if~}}
18+
{{#if cv-qualifiers~}}
19+
{{#if pointee-type}} {{cv-qualifiers}}{{else}}{{cv-qualifiers}} {{/if~}}
20+
{{/if~}}
21+
{{#if id}}{{>xref .}}[{{name}}]{{else if name}}{{name}}{{/if~}}
22+
{{#if (eq kind "specialization")}}{{>template-args args=args}}{{/if}}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{{>declarator-before~}}
1+
{{>declarator-before .~}}
22
{{~#if decl-name}} {{decl-name~}}
3-
{{~#if decl-name-targs~}}{{>template-args args=decl-name-targs}}{{~/if~}}
3+
{{~#if decl-name-targs}}{{>template-args args=decl-name-targs}}{{/if~}}
44
{{~/if~}}
5-
{{~>declarator-after~}}
5+
{{~>declarator-after}}

share/mrdox/addons/generator/asciidoc/partials/enum.adoc.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
=== Synopsis
88

9-
[source,cpp,subs=+macros]
9+
[source,cpp,subs="verbatim,macros,-callouts"]
1010
----
1111
enum {{name}};
1212
----
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
{{!-- data --}}
1+
{{!-- field --}}
2+
[#{{symbol.id}}]
3+
== {{symbol.name}}
4+
5+
{{symbol.doc.brief}}
6+
7+
=== Synopsis
8+
9+
[source,cpp,subs="verbatim,macros,-callouts"]
10+
----
11+
{{#if symbol.isMutable}}mutable
12+
{{/if~}}
13+
{{>declarator-before symbol.type}} {{symbol.name~}}
14+
{{#if symbol.isBitfield}} : {{symbol.bitfieldWidth}}{{/if~}}
15+
{{>declarator-after symbol.type~}}
16+
;
17+
----
18+
19+
{{>source symbol.loc}}
20+
21+
{{#if symbol.doc.description}}
22+
=== Description
23+
24+
{{symbol.doc.description}}
25+
26+
{{/if}}
Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
1-
[source,cpp,subs=+macros]
1+
[source,cpp,subs="verbatim,macros,-callouts"]
22
----
3-
{{#if template}}{{>template-head template}}{{/if~}}
4-
{{#if (eq storageClass "static")}}static
3+
{{#if template}}{{>template-head template}}
54
{{/if~}}
5+
{{#if constexprKind}}{{constexprKind}}
6+
{{/if~}}
7+
{{#if storageClass}}{{storageClass}}
8+
{{/if~}}
9+
{{#if isVirtual}}virtual
10+
{{/if~}}
11+
12+
{{#if (eq class "normal")~}}
613
{{>declarator-before return}}
714
815
{{name~}}
916
{{#if (eq template.kind "explicit")~}}
1017
{{~>template-args args=template.args~}}
11-
{{~/if~}}
12-
13-
{{~#if params}}
14-
(
18+
{{/if~}}
19+
{{else if (neq class "conversion")~}}
20+
{{name~}}
21+
{{else~}}
22+
operator {{>declarator return~}}
23+
{{/if~}}
24+
({{#if params}}
1525
{{#each params}}
1626
{{>declarator type decl-name=name~}}
17-
{{~#if @last}}){{else}},
18-
{{/if}}
19-
{{~/each}}
20-
{{~else~}}
21-
()
22-
{{~/if~}}
27+
{{#if default}} = {{default}}{{/if~}}
28+
{{#unless @last}},
29+
{{/unless~}}
30+
{{/each~}}
31+
{{/if~}})
32+
{{~#if isConst}} const{{/if~}}
33+
{{#if isVolatile}} volatile{{/if~}}
34+
{{#if refQualifier}} {{refQualifier}}{{/if~}}
2335
{{#if (eq exceptionSpec "noexcept")}} noexcept{{/if~}}
24-
{{~>declarator-after return~}}
36+
{{#if (eq class "normal")}}{{>declarator-after return}}{{/if~}}
37+
{{#if hasOverrideAttr}} override{{/if~}}
38+
{{#if isFinal}} final{{/if~}}
39+
{{#if isPure}} = 0{{/if~}}
2540
{{#if isDeleted}} = delete{{/if~}}
41+
{{#if isDefaulted}} = default{{/if~}}
2642
;
2743
----

share/mrdox/addons/generator/asciidoc/partials/info-list.adoc.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
|===
33
|Name |Description
44
{{#each .}}
5-
|{{>xref .}}[`pass:v[{{name}}]`] |pass:v[{{doc.brief}}]
5+
|{{>xref .}}[`pass:v[{{name}}]`] |{{doc.brief}}
66
{{/each}}
77
|===

share/mrdox/addons/generator/asciidoc/partials/namespace.adoc.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
|===
77
|Name |Description
88
{{#each symbol.members}}
9-
|{{>xref .}}[`pass:v[{{name}}]`] |pass:v[{{doc.brief}}]
9+
|{{>xref .}}[`pass:v[{{name}}]`] |{{doc.brief}}
1010
{{/each}}
1111
|===

share/mrdox/addons/generator/asciidoc/partials/record-member.adoc.hbs

Lines changed: 0 additions & 12 deletions
This file was deleted.

share/mrdox/addons/generator/asciidoc/partials/record.adoc.hbs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,22 @@
66

77
=== Synopsis
88

9-
[source,cpp,subs=+macros]
9+
[source,cpp,subs="verbatim,macros,-callouts"]
1010
----
11-
{{#if symbol.template}}
12-
{{>template-head symbol.template}}
11+
{{#if template}}{{>template-head template}}
12+
{{/if~}}
1313
{{symbol.tag}} {{symbol.name~}}
14-
{{#if (neq symbol.template.kind "primary")~}}
15-
{{>template-args args=symbol.template.args}}
16-
{{/if}}
17-
{{else}}
18-
{{symbol.tag}} {{symbol.name~}}
19-
{{/if}}
14+
{{#if (or (eq symbol.template.kind "explicit") (eq symbol.template.kind "partial"))~}}
15+
{{~>template-args args=symbol.template.args}}
16+
{{/if~}}
2017
{{#unless symbol.bases}}
2118
;
2219
{{else}}{{"\n"}}
2320
{{#each symbol.bases}}
2421
{{#if @first}}:{{else}},{{/if}}
2522
{{~#unless (eq access ../symbol.defaultAccess)}} {{access}}{{/unless}}
2623
{{~#if isVirtual}} virtual{{/if}}
27-
{{~null}} {{>declarator type decl-name=""}}
24+
{{~null}} {{>declarator type}}
2825
{{~#if @last}};{{/if}}
2926
{{/each}}
3027
{{/unless}}

0 commit comments

Comments
 (0)