wc-duck / datalibrary

Open Source Data Library for data serialization.
Other
42 stars 8 forks source link

Add json5 support in text-format #54

Closed wc-duck closed 6 years ago

wc-duck commented 7 years ago

http://json5.org

wc-duck commented 6 years ago

Some of the additions to json5 is already supported ( I think ) and just needs tests.

"Objects can have trailing commas" and "Arrays can have trailing commas" might work as it is right now... just need testing :)

single-quotes do not work.

comments work.

I'll be working on this, one feature at a time.

joeldevahl commented 6 years ago

As a comment to this, I'm currently relying on the "feature" that the JSON parser allows newlines in strings. Would like to continue to have that, at least as a togglable extension =)

wc-duck commented 6 years ago

If you have the time I would love to have a unit test for that to make sure that I don't break it by accident.

wc-duck commented 6 years ago

the only issue left in text-data is "split lines in strings with \". I however many of the issues is still valid while parsing .tld:s

wc-duck commented 6 years ago

@lundmark that whiskey is looking more and more relevant ;)

lundmark commented 6 years ago

I have a bottle standing, ready to be consumed!

lundmark commented 6 years ago

This is working pretty good, except that you can't replace colons (:) with equals (=). Also, arrays require commas to separate the elements and that's something json5 allows you to skip. Big improvements in readability for text-based data so far, looking really good!

wc-duck commented 6 years ago

As it is "kind of" done and I can't really pinpoint what is left I will close this in favor of smaller issues as the pop up.