sheredom / json.h

🗄️ single header json parser for C and C++
The Unlicense
710 stars 79 forks source link

JSON improvement: support for // /* */ style comments? #11

Closed ocornut closed 8 years ago

ocornut commented 8 years ago

I think another desirable (but totally optional) feature would be to add support for comments in the reader, possibly only // style if that is easier for the parser, or both // and /* */ style, so that would also be expressed as a flag as you've been adding flags to the entry point.

Should be fairly simple and lightweight, adding a test with '/' token and we can consume all the comment in that block. I'll look into that.

sheredom commented 8 years ago

Yes, I like this. I'll add it to my todo! I've started working on your idea (for the flags and that) in the enable_simplified_json_take2 branch. Got support for unquoted keys and also disabling/re-enabling the allow trailing comma at present.

sheredom commented 8 years ago

https://github.com/sheredom/json.h/commit/f7af53a09f2ad353530b72c7439eb10da4f5f0f5 should have fixed this for you Omar! :)

ocornut commented 8 years ago

Thanks Neil, much appreciated. I probably won't have time to look into the JSON code a short while, but I'll let you know when I do.