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.

OptionalTokenOffset

A relative token index, or null.

Ast.OptionalTokenOffset
pub const OptionalTokenOffset = enum(i32)

File

lib/std/zig/Ast.zig:79

Code

pub const OptionalTokenOffset = enum(i32) {
    none = std.math.maxInt(i32),
    _,

    pub fn unwrap(oto: OptionalTokenOffset) ?TokenOffset {
        return if (oto == .none) null else @fromBackingInt(@intCast(@backingInt(oto)));
    }
}