Jezza/toml

Feature - Write Comments Support

Opened this issue · 0 comments

A248 commented

Writing comments is a very useful feature for higher-level libraries which want to attach helpful tips to toml entries. For example, comments on a configuration option explain what that option is used for.

Some API changes might be required to support comments. For one, a Comment object could be added. Also, TomlTable may have to be outfitted to support more than just booleans, doubles, longs, strings, TomlTables, TomlArrays, and TemporalAccessors. A plain primitive value cannot have a comment attached to it. It might be desirable to switch to some kind of TomlObject hierarchy wrapping each value, where comments can be attached to each object.

I believe writing comments is a sensible feature, but reading comments is more debatable. If comments were read then that would somewhat defeat their purpose as intended for human eyes only.

Depends on an API to write toml: #1