3 ms·
The problem with comments in configuration files is that they don't survive a `load -> native object -> save` round-trip.
by wewxjfq 3y ago
The problem with comments in configuration files is that they don't survive a `load -> native object -> save` round-trip.
- jen20 3y agoThat sounds more like a problem with deserializing configuration instead of parsing.
- peteradio 3y agoComments lie, I think it would make sense to destroy them in load to native.
- riffraff 3y agoShould a configuration language be a serialization language? I'm unconvinced.
- rwmj 3y agoAugeas solves this for many config file formats: http://augeas.net/ http://augeas.net/
- ithkuil 3y agoI played around with "format preserving" edits of a few text formats, including nested formats (a JSON inside a TOML inside a YAML etc) https://github.com/mkmik/knot8 https://github.com/mkmik/knot8
- ilyt 3y agoThey could if you parsed it into syntax tree wit some methods to access keys instead of parsing into native struct. I think I saw YAML parser doing it...