sam701 / zig-toml

Zig TOML (v1.0.0) parser
MIT License
33 stars 10 forks source link

Can't parse anything #11

Open olexij-christian opened 1 day ago

olexij-christian commented 1 day ago

Hello, I have problem when parse with anything template

const ConfigTemplate = struct {
    repo: u8,
};
var parser = toml.Parser(ConfigTemplate).init(allocator);
defer parser.deinit();

const parsed = try parser.parseString(string);

error:

src/struct_mapping.zig:27:10: error: no field named 'struct' in enum '@typeInfo(builtin.Type).Union.tag_type.?'
        .@"struct" => |info| {

builtin.zig:256:18: note: enum declared here
pub const Type = union(enum) {
                 ^~~~~

please help

sirenkovladd commented 1 day ago

related to https://github.com/ziglang/zig/commit/0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9

sam701 commented 5 hours ago

@olexij-christian you see the errors because you are probably using zig 0.13. I try to make sure that the main branch compiles on zig master (because zig is still a young rapidly changing language). If you decide to stick with 0.13, you should use this commit 67e35c75c5d1, I have just tagged it last-zig-0.13.