As reported in https://zigforum.org/t/zig-nestedtext-release-0-1-0/383/17:
test "typed parse: jeang3nie" {
const Kind = union(enum) {
color: []const u8,
plain,
};
var p = Parser.init(testing.allocator, .{});
const r = try p.parseTyped(Kind, "> null");
defer p.parseTypedFree(r);
std.debug.print("{s}\n", .{r});
}
This parses into color with the string null since this is the first field that succeeds, but parsing as a string should probably be the last resort (since this will always succeed).
As reported in https://zigforum.org/t/zig-nestedtext-release-0-1-0/383/17:
This parses into
colorwith the stringnullsince this is the first field that succeeds, but parsing as a string should probably be the last resort (since this will always succeed).