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.

isOneLineErrorSetDecl

Render.isOneLineErrorSetDecl
fn isOneLineErrorSetDecl(
    tree: Ast,
    lbrace: Ast.TokenIndex,
    rbrace: Ast.TokenIndex,
) bool

File

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

Code

fn isOneLineErrorSetDecl(
    tree: Ast,
    lbrace: Ast.TokenIndex,
    rbrace: Ast.TokenIndex,
) bool {
    // If there is a trailing comma, comment, or document comment, then render each
    // item on its own line.
    return tree.tokenTag(rbrace - 1) != .comma and
        !hasDocComment(tree, lbrace + 1, rbrace) and
        !hasComment(tree, lbrace, rbrace);
}