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.

tokensOnSameLine

Ast.tokensOnSameLine
pub fn tokensOnSameLine(tree: Ast, token1: TokenIndex, token2: TokenIndex) bool

File

lib/std/zig/Ast.zig:1299

Code

pub fn tokensOnSameLine(tree: Ast, token1: TokenIndex, token2: TokenIndex) bool {
    const source = tree.source[tree.tokenStart(token1)..tree.tokenStart(token2)];
    return mem.findScalar(u8, source, '\n') == null;
}