Skip to content
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

support for comments #225

Open
yueswing07 opened this issue Dec 19, 2017 · 4 comments
Open

support for comments #225

yueswing07 opened this issue Dec 19, 2017 · 4 comments
Milestone

Comments

@yueswing07
Copy link

yueswing07 commented Dec 19, 2017

there is many situations need read configure file has annotation
i have test the code

char *s = "{//aa \n \"list\":[{\"name\":\"22xiao hong\",\"age\":10},{\"name\":\"33hua hua\",\"age\":\"11\"}]}";  
    cJSON *root = cJSON_Parse(s);

parse return NULL

@FSMaxB
Copy link
Collaborator

FSMaxB commented Dec 19, 2017

Yes, JSON is kind of bad for configuration files because of this. This is why I personally prefer YAML for that, although it requires a much more complex parser.

I can't currently support comments in cJSON, but once #177 is implemented, it could be added as a configuration option.

@FSMaxB FSMaxB added this to the Future milestone Dec 19, 2017
@FSMaxB FSMaxB changed the title support for annotation support for comments Dec 30, 2017
@nemo20000
Copy link

As comments are not part of the JSON standard, this must be optional.

And if we’re listing ‘favourite configuration format that isn’t JSON’, mine is PSON – PostScript Object Notation (which does support comments!).

@FSMaxB
Copy link
Collaborator

FSMaxB commented Jul 25, 2018

As comments are not part of the JSON standard, this must be optional.

This would not be enabled by default of course

@mateosss
Copy link

Has there been any update on this topic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants