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 library itself.
Zig › std/ › zig/ › AstGen.zig › errNoteTokOff
errNoteTokOff
AstGen.errNoteTokOff
fn errNoteTokOff (
astgen : *AstGen ,
token : Ast .TokenIndex ,
byte_offset : u32 ,
comptime format : []const u8 ,
args : anytype ,
) Allocator .Error !u32
File
Code
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 ,
});
}