miniconf-pest-parser 0.1.0

PEG (pest) parser for the MiniConf configuration format with sections and key=value values.
Documentation
  • Coverage
  • 6.25%
    2 out of 32 items documented0 out of 4 items with examples
  • Size
  • Source code size: 14.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 537.58 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kitmelancholic

miniconf-pest-parser

MiniConf is a plain-text configuration format with sections and key = value pairs. This crate provides a PEG grammar written for pest and the Rust structures used in the project.

How it works

  • Sections are declared as [section_name].
  • Keys use ASCII identifiers and are assigned with key = value.
  • Comments start with # and continue to the end of the line.
  • Whitespace (spaces, tabs, newlines) is ignored outside of tokens.

Supported values:

  • Strings in double quotes with simple escapes (\", \n, \t).
  • Decimal numbers, optionally signed.
  • Booleans (true, false).
  • null.
  • Arrays like [value, value].
  • Objects like {key: value}.

All parsed data lands in Document { sections: HashMap<String, HashMap<String, Value>> }, so you can read data as doc.sections["database"]["port"].

Sample

# Project
title = "Project Alpha"
version = 1.0
flags = { debug: true }

[database]
host = "localhost"
port = 5432
tags = ["primary", "ro"]