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 › stringLiteral Private Function stringLiteral Doc Source Private Function std.zig.AstGen.stringLiteral
fn stringLiteral (
gz : *GenZir ,
ri : ResultInfo ,
node : Ast .Node .Index ,
) InnerError !Zir .Inst .Ref Params Errors File zig/AstGen.zig: 8423
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440 fn stringLiteral (
gz : *GenZir ,
ri : ResultInfo ,
node : Ast .Node .Index ,
) InnerError !Zir .Inst .Ref {
const astgen = gz .astgen ;
const tree = astgen .tree ;
const str_lit_token = tree .nodeMainToken (node );
const str = try astgen .strLitAsString (str_lit_token );
const result = try gz .add (.{
.tag = .str ,
.data = .{ .str = .{
.start = str .index ,
.len = str .len ,
} },
});
return rvalue (gz , ri , result , node );
}