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 › AstGen › errNoteNode Private Function errNoteNode Doc Source Private Function std.zig.AstGen.errNoteNode
fn errNoteNode (
astgen : *AstGen ,
node : Ast .Node .Index ,
comptime format : []const u8 ,
args : anytype ,
) Allocator .Error !u32 Params astgen : *AstGen node : Ast .Node .Index format : []const u8 args File zig/AstGen.zig: 10961
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978 fn errNoteNode (
astgen : *AstGen ,
node : Ast .Node .Index ,
comptime format : []const u8 ,
args : anytype ,
) Allocator .Error !u32 {
@branchHint (.cold );
const string_bytes = &astgen .string_bytes ;
const msg : Zir .NullTerminatedString = @fromBackingInt (@intCast (string_bytes .items .len ));
try string_bytes .print (astgen .gpa , format ++ "\x00" , args );
return astgen .addExtra (Zir .Inst .CompileErrors .Item {
.msg = msg ,
.node = node .toOptional (),
.token = .none ,
.byte_offset = 0 ,
.notes = 0 ,
});
}