Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › zig › AstRlAnnotate › containerDecl Private Function containerDecl Doc Source Private Function std.zig.AstRlAnnotate.containerDecl
fn containerDecl (
astrl : *AstRlAnnotate ,
block : ?*Block ,
full : Ast .full .ContainerDecl ,
) !void Params File zig/AstRlAnnotate.zig: 89
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 fn containerDecl (
astrl : *AstRlAnnotate ,
block : ?*Block ,
full : Ast .full .ContainerDecl ,
) !void {
const tree = astrl .tree ;
switch (tree .tokenTag (full .ast .main_token )) {
.keyword_struct => {
if (full .ast .arg .unwrap ()) |arg | {
_ = try astrl .expr (arg , block , ResultInfo .type_only );
}
for (full .ast .members ) |member_node | {
_ = try astrl .expr (member_node , block , ResultInfo .none );
}
},
.keyword_union => {
if (full .ast .arg .unwrap ()) |arg | {
_ = try astrl .expr (arg , block , ResultInfo .type_only );
}
for (full .ast .members ) |member_node | {
_ = try astrl .expr (member_node , block , ResultInfo .none );
}
},
.keyword_enum => {
if (full .ast .arg .unwrap ()) |arg | {
_ = try astrl .expr (arg , block , ResultInfo .type_only );
}
for (full .ast .members ) |member_node | {
_ = try astrl .expr (member_node , block , ResultInfo .none );
}
},
.keyword_opaque => {
for (full .ast .members ) |member_node | {
_ = try astrl .expr (member_node , block , ResultInfo .none );
}
},
else => unreachable ,
}
}