tomlj / tomlj

A Java parser for Tom's Obvious, Minimal Language (TOML).
Apache License 2.0
145 stars 28 forks source link

Toml writer #19

Closed kPYKx7Ddw4n1aIKZ closed 3 years ago

kPYKx7Ddw4n1aIKZ commented 3 years ago

I created a Toml serializer implementation based on the JsonSerializer class. One can use the toToml() method of either the TomlTable or the TomlArray class.

I tested it and it worked for my test cases but it still may not be perfect. I could add a unit test if needed.

This should solve #16 .

kPYKx7Ddw4n1aIKZ commented 3 years ago

I could add a unit test if needed.

I also added unit tests. They parse the existing Toml example files, serialize them, parse the result again and compare them structurally.

ipkpjersi commented 3 years ago

Hi @cleishm hope you are doing well, are there any plans to merge this PR? It looks good to me and even includes unit tests.

kPYKx7Ddw4n1aIKZ commented 3 years ago

I'm closing this as I improved the original change and merged it into my (possibly temporary) fork.

If any maintainer will ever come back here, I can adapt the change and make a pull request again or someone else can cherry-pick it.

Commit