Implement ParserError
This commit is contained in:
parent
ec1df06b24
commit
6ec4a701d3
1 changed files with 20 additions and 0 deletions
|
@ -64,6 +64,26 @@ pub mod file {
|
|||
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 enum FileHeaderSpec {
|
||||
|
|
Loading…
Reference in a new issue