Hejsil / mecha

A parser combinator library for Zig

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delimiter seperated value parser

Hejsil opened this issue · comments

Would be super nice to have a function that parses delimiter separated values (dsv) into a type. Api would be something like this:

pub fn dsv(comptime T: type, comptime delim: Parser(void)) Parser(T) {...}

It would be able to take most types and parse a dsv into that type, doing all the conversions necessary to make this happen.

Open questions:

  • Delimiter escaping?
    • Maybe out of scope as this could become arbitrarily complex.