25 lines
488 B
Rust
25 lines
488 B
Rust
use super::parser::Position;
|
|
use std::io;
|
|
|
|
#[derive(Debug)]
|
|
pub enum GenericError {
|
|
StdIOError(io::Error),
|
|
}
|
|
|
|
impl From<io::Error> for GenericError {
|
|
fn from(error: io::Error) -> Self {
|
|
Self::StdIOError(error)
|
|
}
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub enum CompilerError {
|
|
Fatal,
|
|
PeekFailed,
|
|
ExpectedToken(Position, char),
|
|
ExpectedExpression(Position, Box<CompilerError>),
|
|
ExpectedIdent(Position),
|
|
ExpectedStatement(Position),
|
|
ExpectedPattern(Position),
|
|
}
|