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 › errNoteTokOff Private Function errNoteTokOff Doc Source Private Function std.zig.AstGen.errNoteTokOff
fn errNoteTokOff (
astgen : *AstGen ,
token : Ast .TokenIndex ,
byte_offset : u32 ,
comptime format : []const u8 ,
args : anytype ,
) Allocator .Error !u32 Params astgen : *AstGen token : Ast .TokenIndex byte_offset : u32 format : []const u8 args File zig/AstGen.zig: 10941
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959 fn errNoteTokOff (
astgen : *AstGen ,
token : Ast .TokenIndex ,
byte_offset : u32 ,
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 = .none ,
.token = .fromToken (token ),
.byte_offset = byte_offset ,
.notes = 0 ,
});
}