Fix typo in error name
This commit is contained in:
parent
204bd950a4
commit
ba4b3f09f3
|
@ -7,7 +7,7 @@ pub enum ErrorType {
|
|||
CharNotFound { need: u8, got: u8 },
|
||||
MatchNotFound(&'static [u8]),
|
||||
NotFound(&'static str),
|
||||
UnexpectedChar(u8),
|
||||
ExpectedChar(u8),
|
||||
UnexpectedEnd,
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,8 @@ impl ErrorType {
|
|||
ErrorType::NotFound(exp) => {
|
||||
format!("Expected {}.", exp)
|
||||
}
|
||||
ErrorType::UnexpectedChar(unexp) => {
|
||||
format!("Unexpected {} (U+{:X}).", unexp as char, unexp)
|
||||
ErrorType::ExpectedChar(unexp) => {
|
||||
format!("Expected {} (U+{:X}).", unexp as char, unexp)
|
||||
}
|
||||
ErrorType::UnexpectedEnd => {
|
||||
format!("Unexpected end of source code.")
|
||||
|
|
|
@ -157,7 +157,7 @@ impl<'d> Processor<'d> {
|
|||
match self.match_reason {
|
||||
RequireReason::Custom => Err(ErrorType::NotFound(custom_reason.unwrap())),
|
||||
RequireReason::ExpectedNotChar(c) => Err(ErrorType::CharNotFound { need: c, got: self.match_char.unwrap() }),
|
||||
RequireReason::ExpectedChar(c) => Err(ErrorType::UnexpectedChar(c)),
|
||||
RequireReason::ExpectedChar(c) => Err(ErrorType::ExpectedChar(c)),
|
||||
RequireReason::ExpectedMatch(m) => Err(ErrorType::MatchNotFound(m)),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue