INI element metadata.
Metadata holds text location and layout information (whitespace and comments) for INI elements. When decoding with ~layout:true, this information is captured and can be used to preserve formatting when re-encoding.
Example: A value decoded from:
port = 8080 # server portwould have ws_before = " ", ws_after = " ", and comment = Some "# server port".
val none : tnone is metadata with no information (no location, no whitespace).
make ?ws_before ?ws_after ?comment textloc creates metadata.
ws_beforeis whitespace preceding the element.ws_afteris whitespace following the element.commentis an associated comment (including the#or;).textlocis the source location.
val is_none : t -> boolis_none m is true iff m has no text location.
val ws_before : t -> stringws_before m is whitespace that appeared before the element.
val ws_after : t -> stringws_after m is whitespace that appeared after the element.
val comment : t -> string optioncomment m is the comment associated with the element, if any. Includes the comment prefix (# or ;).
Functional updates
clear_textloc m is m with textloc set to Textloc.none.