Separate error

This commit is contained in:
2026-05-14 20:51:43 +02:00
parent 5920a9f236
commit 192769c8ad
2 changed files with 21 additions and 17 deletions
+18
View File
@@ -0,0 +1,18 @@
use crate::Rule;
pub type ParseResult<'a, T> = Result<T, ParseError<'a>>;
#[derive(Debug, Clone)]
pub enum ParseError<'a> {
PreAst(pest::error::Error<Rule>),
Ast {
span: pest::Span<'a>,
error_code: ErrorCode,
error_message: String,
},
}
#[derive(Debug, Clone)]
pub enum ErrorCode {
InvalidStatement = 200,
}