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/ › parser_fuzz.zig › logSourceInner
logSourceInner
parser_fuzz.logSourceInner
fn logSourceInner (source : []const u8 , t : std .Io .Terminal ) std .Io .Writer .Error !void
File
Code
fn logSourceInner (source : []const u8 , t : std .Io .Terminal ) std .Io .Writer .Error !void {
@disableInstrumentation ();
const w = t .writer ;
t .setColor (.dim ) catch {};
try w .writeAll ("=== Source ===\n" );
t .setColor (.reset ) catch {};
var line : usize = 1 ;
try w .print ("{: >5} " , .{line });
for (source ) |c | switch (c ) {
' ' ...0x7e => try w .writeByte (c ),
'\n' => {
line += 1 ;
try w .print ("\n{: >5} " , .{line });
},
'\r' => {
t .setColor (.cyan ) catch {};
try w .writeAll ("\\r" );
t .setColor (.reset ) catch {};
},
'\t' => {
t .setColor (.cyan ) catch {};
try w .writeAll ("\\t" );
t .setColor (.reset ) catch {};
},
else => {
t .setColor (.cyan ) catch {};
try w .print ("\\x{x:0>2}" , .{c });
t .setColor (.reset ) catch {};
},
};
try w .writeByte ('\n' );
}