Martini is a Rust based INI file parser. It was born during my recreational programming sessions.
INI files are configuration files used for computer software configuration (typically Windows). Each file describes several named sections . These sections have key-value pairs inside of them.
The file format isn't too formally defined. There are some things that are standard and some things which vary. The goals section defines all specifications (to be) implemented in this project.
We'd like to achieve parsing for following features and properties. Some of these are implicitly guaranteed.
- Sections (
[section]
) - Keys/Properties (
key=value
) - Case sensitivity
- Comments (
; is a comment
) - Irrelevant ordering of sections
- Blank properties (There's no value. e.g.
key=
) - Global properties
- Different delimiters for properties:
-
<space>
-
:
-
- Hierarchy: Nesting the section
-
[section.subsection]
-
[.subsection]
where nesting undersection
is inferred
-
- Variants of comments:
-
#
,
-
- Duplicate properties with multiple parsing strategies:
- Ignore: Ignore the latest conflicting duplicate.
- Overwrite: Overwrite the original property with the new one.
- Allow multiple: Allow multiple values to co-exist.