jm / toml

Parse TOML. Like a bawss.
MIT License
151 stars 37 forks source link

New grammar-based parsing system #2

Closed dirk closed 11 years ago

dirk commented 11 years ago

So I got a little over-zealous and just hacked together a whole new system based on Parslet. It's hopefully much more readable and maintainable (the exact thing all the JSON/YAML/XML/etc. parsers out there aren't) and should handle nested arrays, escape sequences in strings, and multi-key keygroups ([a.b.c]). Your thoughts?

I'll be pushing some refactorings and such later; just wanted to get your preliminary opinion.

jm commented 11 years ago

I was kind of :-1: on adding dependencies, but I think you're right about the maintainability. The nested array parsing alone was going to be a huge annoyance I think. I'll merge this in and play with it tonight, but I'll probably make this the default parser now. I like the idea of it at least if the performance holds up.

dirk commented 11 years ago

Yeah; keeping dependency-free would be nice. On the upside Parslet is pure Ruby so at least it will hopefully Install Anywhere(tm). Performance shouldn't be atrocious from my experience using Parslet on other projects, and I'm guessing TOML isn't supposed to be used in any performance-critical applications anyways.

jm commented 11 years ago

Yup. I merged it and did a bunch of little tweaks to it. Going to do just a little more then call it awesome. :metal: Great job on this!!

dirk commented 11 years ago

Thanks! Let me know if there's anything I can do.