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.

isMatchingIdent

Walk.isMatchingIdent
fn isMatchingIdent(ast: *const Ast, node: Ast.Node.Index, string: []const u8) bool

File

Code

fn isMatchingIdent(ast: *const Ast, node: Ast.Node.Index, string: []const u8) bool {
    switch (ast.nodeTag(node)) {
        .identifier => {
            const token_index = ast.nodeMainToken(node);
            const name_bytes = ast.tokenSlice(token_index);
            return std.mem.eql(u8, name_bytes, string);
        },
        else => return false,
    }
}