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

Add support for YAML comments as an option #47

Closed
cowtowncoder opened this issue Dec 11, 2012 · 2 comments
Closed

Add support for YAML comments as an option #47

cowtowncoder opened this issue Dec 11, 2012 · 2 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

Regrettably it looks like YAML does not support C or C++ comments but only scripting comments (hash sign until end of the line). While this should not cause problems with JSON per se, there are some cases where this is problematic: specifically, when YAML is viewed as a superset of JSON; in which case one has no common comments (granted, comments are not in standard JSON, so it is superset of standard JSON).

Anyway: ability to enable handling of "hash comments" would be useful and simple to implement; quite similar to how C++ comments are handled. As such, it would make sense to add in 2.2.

@cowtowncoder
Copy link
Member Author

Hmmh. Turns out that highly optimized implementation of decoding makes this more difficult than I thought -- tight loop for skipping white-space is only called for characters below value of hash character.
Will need to see if this could still be implemented or not.

@cowtowncoder
Copy link
Member Author

Implemented in the end by modifying white-space handling loop, changing to use lookup table. Hopefully no measurable performance impact.

cowtowncoder added a commit that referenced this issue Sep 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant