Skip to main content

Module ini

Module ini 

Source
Expand description

INI Core v1: a deliberately small, deterministic INI dialect.

Entries before the first [section] header belong to the document root and are addressed by their bare key. Refusing them was a smaller dialect but not a truthful one: a flat key=value file — phoenixd’s phoenix.conf, most of /etc/*.conf, php.ini’s preamble — is the shape people most often need one value out of, and having no reader for it pushed callers back to grep | cut, which is what this module exists to replace.

The cost is one ambiguity, and it is refused rather than resolved: a root key and a section of the same name would both address the same top-level name, so a document containing both is a parse error.

Structs§

IniDocument
Parsed INI Core v1 source document. The lexer used for semantic loading and source editing is intentionally shared so both paths enforce the same section/key/duplicate rules.

Functions§

load
save
set_preserving
Replace an existing INI scalar without reordering sections or entries.
unset_preserving
Remove an existing INI entry without rewriting the document.