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.

renderOnlySpace

Render.renderOnlySpace
fn renderOnlySpace(r: *Render, space: Space) Error!void

File

lib/std/zig/Ast/Render.zig:2787

Code

fn renderOnlySpace(r: *Render, space: Space) Error!void {
    const ais = r.ais;
    switch (space) {
        .none => {},
        .space, .maybe_space => try ais.writeByte(' '),
        .newline => try ais.insertNewline(),
        .comma, .comma_maybe_space => try ais.writeAll(",\n"),
        .comma_space => try ais.writeAll(", "),
        .semicolon => try ais.writeAll(";\n"),
        .skip => unreachable,
    }
}