Getting error handling to work

This commit is contained in:
2026-05-15 00:03:04 +02:00
parent cdb34984db
commit 25f4b5470d
13 changed files with 136 additions and 106 deletions
+2 -2
View File
@@ -7,13 +7,13 @@ pub mod parser;
use ast::*;
use crate::error::{GetParseError, ParseResult};
use crate::error::{GetParseError, ParseError};
#[derive(Parser)]
#[grammar = "./src/grammar.pest"]
pub struct MistParser;
pub fn parse<'a>(source: &'a str) -> ParseResult<'a, Vec<TopLevel>> {
pub fn parse<'a>(source: &'a str) -> Result<Vec<TopLevel>, ParseError<'a, Vec<TopLevel>>> {
let mut pairs = MistParser::parse(Rule::program, source)?;
let mut statements = vec![];