Skip to content

Commit af254c3

Browse files
committed
feat: recursive TypeInfo structure
closes #209, closes #343
1 parent 940033e commit af254c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1735
-435
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{#if (eq kind "lvalue-reference")~}}
2+
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}){{~/if~}}
3+
{{~>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")~}}
14+
{{~>declarator-after pattern-type~}}
15+
{{~else if (eq kind "array")~}}
16+
[{{bounds-value}}]
17+
{{~>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~}})
22+
{{~#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~}}
25+
{{~>declarator-after return-type~}}
26+
{{/if}}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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:{{id}}[{{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:{{id}}[{{name~}}]{{else}}{{name~}}{{/if}}
12+
{{~>template-args args=template-args~}}
13+
{{~else if (eq kind "lvalue-reference")~}}
14+
{{~>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")~}}
31+
{{~>declarator-before element-type~}}
32+
{{~else if (eq kind "function")~}}
33+
{{~>declarator-before return-type~}}
34+
{{/if}}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{>declarator-before~}}
2+
{{~#if decl-name}} {{decl-name~}}
3+
{{~#if decl-name-targs~}}{{>template-args args=decl-name-targs}}{{~/if~}}
4+
{{~/if~}}
5+
{{~>declarator-after~}}
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
[source,cpp,subs=+macros]
22
----
3-
{{#if (eq storageClass "static")}}
4-
static
5-
{{/if}}
6-
{{>type-name return}}
3+
{{#if template}}{{>template-head template}}{{/if~}}
4+
{{#if (eq storageClass "static")}}static
5+
{{/if~}}
6+
{{>declarator-before return}}
77
8-
{{#if params}}
9-
{{name}}(
8+
{{name~}}
9+
{{#if (eq template.kind "explicit")~}}
10+
{{~>template-args args=template.args~}}
11+
{{~/if~}}
12+
13+
{{~#if params}}
14+
(
1015
{{#each params}}
11-
{{>type-name type~}}
12-
{{#if name}} {{name}}{{/if}}
16+
{{>declarator type decl-name=name~}}
1317
{{~#if @last}}){{else}},
1418
{{/if}}
1519
{{~/each}}
1620
{{~else~}}
17-
{{name}}()
21+
()
1822
{{~/if~}}
1923
{{#if (eq exceptionSpec "noexcept")}} noexcept{{/if~}}
24+
{{~>declarator-after return~}}
2025
{{#if isDeleted}} = delete{{/if~}}
2126
;
2227
----

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{#if (eq kind "function")}}
22
{{#if (eq storageClass "static")}}static {{/if~}}
3-
{{>type-name return}} {{name}}(
3+
{{>declarator return decl-name=""}} {{name}}(
44
{{~#each params}}
5-
{{>type-name type}}
5+
{{>declarator type decl-name=""}}
66
{{#if name}} {{name}}{{/if}}
77
{{~#unless @last}}, {{/unless}}
88
{{~/each}})

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
{{#if symbol.template}}
1212
{{>template-head symbol.template}}
1313
{{symbol.tag}} {{symbol.name~}}
14-
{{>template-args symbol.template}}
14+
{{#if (neq symbol.template.kind "primary")~}}
15+
{{>template-args args=symbol.template.args}}
16+
{{/if}}
1517
{{else}}
1618
{{symbol.tag}} {{symbol.name~}}
1719
{{/if}}
@@ -22,7 +24,7 @@
2224
{{#if @first}}:{{else}},{{/if}}
2325
{{~#unless (eq access ../symbol.defaultAccess)}} {{access}}{{/unless}}
2426
{{~#if isVirtual}} virtual{{/if}}
25-
{{~null}} {{type.name}}
27+
{{~null}} {{>declarator type decl-name=""}}
2628
{{~#if @last}};{{/if}}
2729
{{/each}}
2830
{{/unless}}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{{#if (neq kind "primary")~}}<
2-
{{~#each args~}}
1+
<{{~#each args~}}
32
{{value}}
43
{{~#if (not @last)}}, {{/if}}
5-
{{~/each~}}
6-
>{{/if}}
4+
{{~/each~}}>
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
{{#if params~}}
12
template<
23
{{#each params}}
34
{{#if (eq kind "type")}}
4-
{{>type-tparam~}}
5+
{{>tparam-type~}}
56
{{else if (eq kind "non-type")}}
6-
{{>nontype-tparam~}}
7+
{{>tparam-nontype~}}
78
{{else if (eq kind "template")}}
8-
{{>template-tparam~}}
9+
{{>tparam-template~}}
910
{{/if}}
1011
{{~#unless @last}},
1112
{{else}}
1213
{{/unless}}
1314
{{/each}}>
15+
{{else~}}
16+
template<>
17+
{{/if}}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{>type-name type}}
1+
{{>declarator type decl-name=""}}
22
{{~#if is-pack}}...{{/if}}
33
{{~#if name}} {{name}}{{/if}}
44
{{~#if default}} = {{default}}{{/if~}}

0 commit comments

Comments
 (0)