extern crate nom;
#[macro_use]
mod utils;
#[macro_use]
mod whitespace;
mod commands;
mod expressions;
mod idents;
mod memory;
mod numbers;
mod script;
mod sections;
mod statements;
pub use commands::Command;
pub use expressions::BinaryOperator;
pub use expressions::Expression;
pub use expressions::UnaryOperator;
pub use memory::Region;
pub use script::RootItem;
pub use sections::DataType;
pub use sections::OutputSectionCommand;
pub use sections::OutputSectionConstraint;
pub use sections::OutputSectionType;
pub use sections::SectionCommand;
pub use sections::SectionPattern;
pub use statements::AssignOperator;
pub use statements::Statement;
pub fn parse(ldscript: &str) -> Result<Vec<RootItem>, String> {
match script::parse(ldscript) {
Ok((_, result)) => Ok(result),
Err(e) => Err(format!("Parsing failed, error: {:?}", e)),
}
}