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 › ZonGen › setBigIntLiteralNode Private Function setBigIntLiteralNode Doc Source 707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722 fn setBigIntLiteralNode (zg : *ZonGen , dest_node : Zoir .Node .Index , src_node : Ast .Node .Index , val : std .math .big .int .Const ) !void {
try zg .extra .ensureUnusedCapacity (zg .gpa , 2 );
try zg .limbs .ensureUnusedCapacity (zg .gpa , val .limbs .len );
const limbs_idx : u32 = @intCast (zg .limbs .items .len );
zg .limbs .appendSliceAssumeCapacity (val .limbs );
const extra_idx : u32 = @intCast (zg .extra .items .len );
zg .extra .appendSliceAssumeCapacity (&.{ @intCast (val .limbs .len ), limbs_idx });
zg .setNode (dest_node , .{
.tag = if (val .positive ) .int_literal_pos else .int_literal_neg ,
.data = extra_idx ,
.ast_node = src_node ,
});
}