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.

renderExpressionComma

Render an expression, and the comma that follows it, if it is present in the source. If a comma is present, and space is Space.comma, render only a single comma.

Render.renderExpressionComma
fn renderExpressionComma(r: *Render, node: Ast.Node.Index, space: Space) Error!void

File

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

Code

fn renderExpressionComma(r: *Render, node: Ast.Node.Index, space: Space) Error!void {
    const tree = r.tree;
    const maybe_comma = tree.lastToken(node) + 1;
    if (tree.tokenTag(maybe_comma) == .comma and space != .comma) {
        try renderExpression(r, node, .none);
        return renderToken(r, maybe_comma, space);
    } else {
        return renderExpression(r, node, space);
    }
}