No description
- Zig 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .gitignore | ||
| adapter.zig | ||
| build.zig | ||
| build.zig.zon | ||
| Parser.zig | ||
| README.md | ||
| root.zig | ||
kosm_toml
TOML for kosm: the toml adapter reads and writes .toml files, such as alacritty's
config and vicinae's themes. Apps use it through output.edit, output.generate and
output.block; it knows no app.
- Paths: every way TOML nests a key reaches the same path.
[colors.primary]withbackground = ...,colors.primary.background = ...andcolors = { primary = { background = ... } }are allcolors.primary.background, and a table spelled in several places is one table. A key holding a dot is a quoted segment:"dim.foreground". - Arrays of tables:
[[keyboard.bindings]]headers are one list, reached throughselection.elements; a[keyboard.bindings.x]header below one belongs to its last element, as TOML says. - Values: strings are written as basic strings (
"..."), colors and joined values as strings too,#rrggbbby default. A float always keeps a.or an exponent (13.0), since13would be read back as an integer;infandnanare written as TOML spells them. Booleans are onlytrue/false, soformat.booleanmust stay.true_false. Lists and tables set byeditare written inline ([1, 2],{ x = 10 }). - Whole files:
generatewrites a table's own values first, then its tables as[sections]and its lists of tables as[[arrays of tables]]. - Reading: the parser follows TOML 1.0 and reads TOML 1.1's inline tables across lines.
Anything TOML rejects (a key defined twice, a table header repeated, an unquoted
yes) is an error naming the line, and nothing is written. - Blocks:
# kosm:begin <id>comments.