corosync-config-parser 0.1.0

A Rust crate for hassle-free Corosync's configuration file parsing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub mod config;
pub mod error;
pub mod lexer;
pub mod parser;

pub use config::ConfigBlock;
pub use error::{Error as ParseError, Result};

pub fn parse(data: String) -> Result<ConfigBlock> {
    let owned_string = Box::leak(data.into_boxed_str());

    match lexer::run(Box::new(owned_string.chars())) {
        Ok(tokens) => parser::run(Box::new(tokens.into_iter())),
        Err(err) => Err(err),
    }
}