Archived
16 lines
347 B
Rust
16 lines
347 B
Rust
use thiserror::Error;
|
|
|
|
pub type CompileResult<T> = Result<T, CompileError>;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum CompileError {
|
|
#[error("lexer error at position {pos}: {msg}")]
|
|
Lex { pos: usize, msg: String },
|
|
|
|
#[error("parse error: {msg}")]
|
|
Parse { msg: String },
|
|
|
|
#[error("codegen error: {msg}")]
|
|
Codegen { msg: String },
|
|
}
|