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 › zon › parse › Parser › failTokenFmtNote Private Type Function failTokenFmtNote Doc Source Private Type Function std.zon.parse.Parser.failTokenFmtNote
fn failTokenFmtNote (
self : @This (),
token : Ast .TokenIndex ,
offset : u32 ,
comptime fmt : []const u8 ,
args : anytype ,
note : ?Error .TypeCheckFailure .Note ,
) error File zon/parse.zig: 1019
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040 fn failTokenFmtNote (
self : @This (),
token : Ast .TokenIndex ,
offset : u32 ,
comptime fmt : []const u8 ,
args : anytype ,
note : ?Error .TypeCheckFailure .Note ,
) error { OutOfMemory , ParseZon } {
@branchHint (.cold );
comptime assert (args .len > 0 );
if (self .diag ) |s | s .type_check = .{
.token = token ,
.offset = offset ,
.message = std .fmt .allocPrint (self .gpa , fmt , args ) catch |err | {
if (note ) |n | n .deinit (self .gpa );
return err ;
},
.owned = true ,
.note = note ,
};
return error .ParseZon ;
}