#[cfg(test)]
mod tests;
mod error;
mod flatten;
mod iters;
mod link;
mod node;
pub use error::FlattenResult;
pub use iters::*;
pub use node::*;
use std::borrow::Cow;
use std::collections::BTreeMap;
pub fn parse<'a, C>(cddl: C) -> FlattenResult<BTreeMap<String, node::LinkedNode>>
where
C: Into<Cow<'a, str>>,
{
flatten::flatten(&cddl.into()).and_then(link::link)
}