Skip to content

error: use of undeclared identifier 'c' #7

@milahu

Description

@milahu

basic usage is unclear

im a zig noob, so i have no idea whats wrong here

zig init-exe 
( cd src && git submodule add https://github.com/alexnask/ctregex.zig )
// src/main.zig

const std = @import("std");
const ctregex = @import("ctregex.zig/ctregex.zig");

pub fn main() anyerror!void {
    const s = "asdf";
    const stdout = std.io.getStdOut().writer();

    if (try ctregex.match("(asdf)", .{.encoding = .utf8}, s)) |res| {
        try stdout.print("match = {s}\n", .{ res.captures[1] });
    }
}
zig build run 

src/ctregex.zig/ctregex.zig:467:162: error: use of undeclared identifier 'c'
            } else parser.consumeNotOneOf(special_brackets) orelse parser.raiseError("Expected a valid character after - in bracket rule, got character '{}'", .{c});
                                                                                                                                                                 ^

} else parser.consumeNotOneOf(special_brackets) orelse parser.raiseError("Expected a valid character after - in bracket rule, got character '{}'", .{c});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions