1#![deny(unsafe_code)]
2#![warn(missing_docs)]
3
4pub mod ast;
11pub mod error;
13#[allow(missing_docs)]
15pub mod parser;
16
17pub use ast::{Document, Entry, Section, Value};
18pub use error::{MiniConfError, ParseErrorKind};
19
20pub fn parse_str(source: &str) -> Result<Document, MiniConfError> {
22 parser::parse_document(source)
23}
24
25#[cfg(test)]
26mod tests {
27 use super::*;
28
29 #[test]
30 fn parses_minimal_document() {
31 let doc = parse_str("key = value\n").expect("parsed");
32 let root = doc.section("root").expect("root section");
33 assert_eq!(root.entries[0].key, "key");
34 }
35}