-
Notifications
You must be signed in to change notification settings - Fork 93
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
String formaters #284
Comments
The current emitter does scan the scalar strings and picks styles based on somewhat serendipitous heuristics. These heuristics could be improved; in this particular case it is likely that the use of But in the end this boils down to efficiency of emitting vs responsibility for sanity of the emitted YAML. Should it be the user or the emitter that is responsible for the style choices? This is an issue that has plagued me from the start. Ideally, I'd like to be able to emit without any emit-time scan of the string. That would require a feature mask for the scalar contents, somewhat like the current Maybe this could be as simple as adding a per-node off-switch for emit-time heuristics. Or emitter flags. Or both per-node and emitter flags. One thing is clear: much more work is needed in emitting styles. |
It seems that strings containing a reserved indicator
-
will be formatted with enclosed single quotes as recommended here.This post suggest this with references from the v1.2.2 specification:
Double-quoted style:
Single-quoted style:
Plain (unquoted) style:
TL;DR
Does single quoting every reserved indicator reduce complexity and increase performance for ryml at the cost of readability (not a huge lost) ? I am curious about how strings are formatted in ryml.
The text was updated successfully, but these errors were encountered: