1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Yaml-based configuration parsing and validation library
//!
//! # Example
//!
//! ```rust,ignore  # for some reason this crashes compiler
//! extern crate quire;
//! #[macor_use] extern crate serde_derive;
//! use quire::{parse_config, Options};
//! use quire::validate::{Structure, Scalar};
//!
//! #[derive(Deserialize)]
//! struct Config {
//!     item1: String,
//!     item2: Option<String>,
//! }
//!
//! fn validator<'static>() -> Structure<'static> {
//!     Structure::new()
//!     .member("item1", Scalar::new())
//!     .member("item2", Scalar::new().optional())
//! }
//!
//! let cfg: Config;
//! cfg = parse_config("config.yaml", &validator(), &Options::default())
//!       .expect("valid config");
//!
//! ```
//!
#![warn(missing_debug_implementations)]


extern crate humannum;
extern crate num_traits;
extern crate serde;
#[cfg(test)] #[macro_use] extern crate serde_derive;
#[cfg(test)] extern crate serde_humantime;
#[cfg(test)] extern crate serde_json;
#[cfg(test)] extern crate serde_transcode;
#[macro_use] extern crate quick_error;

pub use sky::{parse_config, parse_string};
pub use options::{Options, Include};
pub use errors::{Error, ErrorList, ErrorCollector};
pub use tokenizer::{Pos};
pub use parser::{parse as raw_parse};
//pub use emit::{emit_ast, emit_object};

mod chars;
mod errors;
mod tokenizer;
mod options;
mod parser;
//mod emit;
mod de;
mod sky;
pub mod ast;
pub mod validate;
#[cfg(test)] mod test_errors;
#[cfg(test)] mod test_transcode;