Documentation ¶
Overview ¶
Package ini is a minimal markup language for config files
Specification:
Entries:
- an entry contains three fields a. section of type string a. key of type string b. value of type string c. comment of type string
Parser state:
0. a section of type string, initially empty 1. a comment of type string, initially empty
Parser semantics:
- the byte stream is broken up into lines a. lines are split by the separator regex '\r?\n' b. a separator may be escaped with '\' causing it not to split c. an escaping '\' is removed from the contents of the line d. the line is always joined with '\n'
1. lines beginning with '#' are comments and are ignored
2. empty space trimmed lines are valid and ignored
- lines beginning with '[' and ending with ']' are section declarations a. the line is invalid if the contents contain '[', ']', '\', '=', or '#' b. the contents between the '[' and ']' become the section c. the comment state is reset to empty
- lines containing the string "=" are entries a. the entry key is the space trimmed portion before the first "=" b. the entry value is the space trimmed portion after the first "=" c. the comment state has the final '\n' removed, if it exists d. entries are immediately emitted e. when an entry is emitted, the comment state is reset to empty
- anything else is an invalid line a. invalid lines causes Read to return an error
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.