corosync_config_parser/lib.rs
1pub mod config;
2pub mod error;
3pub mod lexer;
4pub mod parser;
5
6pub use config::ConfigBlock;
7pub use error::{Error as ParseError, Result};
8
9pub fn parse(data: String) -> Result<ConfigBlock> {
10 let owned_string = Box::leak(data.into_boxed_str());
11
12 match lexer::run(Box::new(owned_string.chars())) {
13 Ok(tokens) => parser::run(Box::new(tokens.into_iter())),
14 Err(err) => Err(err),
15 }
16}