Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Private Struct

WipDecls

Private Struct
std.zig.AstGen.WipDecls
const WipDecls = struct

Fields

astgen: *AstGen
slice: Scratch.Slice
index: u32

Functions

fn init(scratch: *Scratch, decls_len: u32) Allocator.Error!WipDecls
fn finish(wip: *WipDecls) void
fn nextDecl(wip: *WipDecls, decl_inst: Zir.Inst.Index) void

File

zig/AstGen.zig:3945
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
const WipDecls = struct {
    astgen: *AstGen,
    slice: Scratch.Slice,
    index: u32,

    fn init(scratch: *Scratch, decls_len: u32) Allocator.Error!WipDecls {
        return .{
            .astgen = scratch.astgen,
            .slice = try scratch.addSlice(decls_len),
            .index = 0,
        };
    }
    fn finish(wip: *WipDecls) void {
        assert(wip.index == wip.slice.len);
        wip.* = undefined;
    }
    fn nextDecl(wip: *WipDecls, decl_inst: Zir.Inst.Index) void {
        wip.slice.get(wip.astgen)[wip.index] = @backingInt(decl_inst);
        wip.index += 1;
    }
}