sam701 / zig-toml

Zig TOML (v1.0.0) parser
MIT License
35 stars 13 forks source link

Make API better (arena + no leak memory) #3

Closed iacore closed 1 year ago

iacore commented 1 year ago

Parsed is std.json.Parsed but simpler

sam701 commented 1 year ago

Thank you for your contribution! I like the improvement. We should make it complete. I see the build_and_test github action is failing. There are a few things:

  1. The Parser.parseFile should have the same return time as parseString.
  2. There is probably no need for Parser.alloc.
  3. Parser.error_info could go into Parsed and then there is no need for Parser at all.

Do you want to address those in your PR? If it's too much, I can take it, but it will take about a week, since I'm on vacation now.

iacore commented 1 year ago

I tried your suggestion. The API would become unwieldy (like Rust Result<>).

I want to keep the API as-is.

sam701 commented 1 year ago

@iacore Thank you for the valuable contribution. I'm sorry I overlooked your reply on Jul 30th.