-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented serialization using pretty print #19
base: master
Are you sure you want to change the base?
Conversation
… into feature/pretty-print
…feature/pretty-print
The code is a bit messy right now, but we are working on improving it. This fixes bug #17 . |
It looks good. I want to merge it, but still feel it lacks some sort of tests. Maybe not needed for "pretty printing", but some might use it for more then that (like generating TOML files). Would it be possible to add some basic tests for this? (most features of |
I also wonder if it is not better to ship this as a separate package |
I would appreciate having pretty printer for toml data type. I don't think you need to put this into separate library. As for me, having in pretty-printing is very important. Consider next scenario: you have config in TOML format, you parse it, you modify it and then you need to write it back. |
Sorry all involved. I had you wait much longer then should have. And thanks @chshersh for chiming in. So 3 is a crowd and thus PP is now the most requested feature. I want to pull the code in, but think it needs at least one test case. Like one complex TOML tile that gets parsed (internal representation A), PPed, that output reparsed (internal representation B). A and B need to be the same. Bonus points for using QuickCheck to generate the initial internal state :) TOML is quite heavily tested, and I think all code should be under some test for a library like this. Final note: if we internally represent whitespace and comments then this feature will be more complete, but I'm ok with pulling the code in without that (it just needs a test). |
Implemented printing of a toml using pretty printing combinators.
Using the printer on the example file produces: