Implement ParserError

This commit is contained in:
Matthias Beyer 2015-10-28 17:37:58 +01:00
parent ec1df06b24
commit 6ec4a701d3

View file

@ -64,6 +64,26 @@ pub mod file {
explanation: Option<String>, explanation: Option<String>,
} }
impl ParserError {
fn new(sum: &'static str, text: String, idx: i32, expl: &'static str) -> ParserError {
ParserError {
summary: String::from(sum),
parsertext: text,
index: idx,
explanation: Some(String::from(expl)),
}
}
fn short(sum: &'static str, text: String, idx: i32) -> ParserError {
ParserError {
summary: String::from(sum),
parsertext: text,
index: idx,
explanation: None
}
}
}
pub mod header { pub mod header {
pub enum FileHeaderSpec { pub enum FileHeaderSpec {