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 › floatUnOp Private Function floatUnOp Doc Source Private Function std.zig.AstGen.floatUnOp
fn floatUnOp (
gz : *GenZir ,
scope : *Scope ,
ri : ResultInfo ,
node : Ast .Node .Index ,
operand_node : Ast .Node .Index ,
tag : Zir .Inst .Tag ,
) InnerError !Zir .Inst .Ref Params Errors File zig/AstGen.zig: 9821
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839 fn floatUnOp (
gz : *GenZir ,
scope : *Scope ,
ri : ResultInfo ,
node : Ast .Node .Index ,
operand_node : Ast .Node .Index ,
tag : Zir .Inst .Tag ,
) InnerError !Zir .Inst .Ref {
const result_type = try ri .rl .resultType (gz , node );
const operand_ri : ResultInfo .Loc = if (result_type ) |rt | .{
.ty = try gz .addExtendedPayload (.float_op_result_ty , Zir .Inst .UnNode {
.node = gz .nodeIndexToRelative (node ),
.operand = rt ,
}),
} else .none ;
const operand = try expr (gz , scope , .{ .rl = operand_ri }, operand_node );
const result = try gz .addUnNode (tag , operand , node );
return rvalue (gz , ri , result , node );
}