1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
source: varnish-macros/src/tests.rs
---
VmodInfo {
params: VmodParams {
docs: None,
},
ident: "types",
docs: "main docs\n# Big header\n## sub header\nfoo bar\nMultiline\n* comment per https://github.com/rust-lang/rust/issues/32088\n*\n* The end",
funcs: [
FuncInfo {
func_type: Function,
ident: "with_docs",
docs: "doctest on a function\nwith multiple lines\n# Big header\n## sub header\n* foo\n* bar",
has_optional_args: false,
args: [],
output_ty: Default,
out_result: false,
},
FuncInfo {
func_type: Function,
ident: "no_docs",
docs: "",
has_optional_args: false,
args: [],
output_ty: Default,
out_result: false,
},
FuncInfo {
func_type: Function,
ident: "doctest",
docs: "doctest on a function",
has_optional_args: false,
args: [
ParamTypeInfo {
ident: "_no_docs",
docs: "",
ty: Value(
ParamInfo {
kind: Regular,
default: Null,
ty_info: I64,
},
),
},
ParamTypeInfo {
ident: "_v",
docs: "doc comment on *function arguments* are invalid in Rust,\nbut they are parsed by macros.\nwe can generate documentation for param `_v` here.\n\n## Example\nThis comment is multi-lined to ensure multiple `#[doc]` are parsed correctly.",
ty: Value(
ParamInfo {
kind: Regular,
default: Null,
ty_info: I64,
},
),
},
],
output_ty: Default,
out_result: false,
},
FuncInfo {
func_type: Function,
ident: "arg_only",
docs: "",
has_optional_args: false,
args: [
ParamTypeInfo {
ident: "_v",
docs: "doc comment for `arg_only`",
ty: Value(
ParamInfo {
kind: Regular,
default: Null,
ty_info: I64,
},
),
},
],
output_ty: Default,
out_result: false,
},
],
objects: [
ObjInfo {
ident: "DocStruct",
docs: "doctest for `DocStruct` implementation",
constructor: FuncInfo {
func_type: Constructor,
ident: "new",
docs: "doctest for `new`",
has_optional_args: true,
args: [
ParamTypeInfo {
ident: "cap",
docs: "doc comment for `cap`",
ty: Value(
ParamInfo {
kind: Optional,
default: Null,
ty_info: I64,
},
),
},
],
output_ty: SelfType,
out_result: false,
},
destructor: FuncInfo {
func_type: Destructor,
ident: "_fini",
docs: "",
has_optional_args: false,
args: [],
output_ty: Default,
out_result: false,
},
funcs: [
FuncInfo {
func_type: Method,
ident: "function",
docs: "doctest for the object function",
has_optional_args: false,
args: [
ParamTypeInfo {
ident: "self",
docs: "self docs - note that `rustfmt` will put `&self` right after this comment\non the same line, effectively removing the code!\nWe cannot really document it anyway, so we parse it but skip it later.",
ty: SelfType,
},
ParamTypeInfo {
ident: "key",
docs: "param docs",
ty: Value(
ParamInfo {
kind: Regular,
default: Null,
ty_info: Str,
},
),
},
],
output_ty: Default,
out_result: false,
},
],
},
],
shared_types: SharedTypes {
shared_per_task_ty: None,
shared_per_vcl_ty: None,
},
}