Start with hand writing the parser again.

This commit is contained in:
2025-09-06 22:06:21 -07:00
parent 8657c009c8
commit 24e6bf6318
5 changed files with 271 additions and 540 deletions

View File

@@ -7,6 +7,17 @@ use thiserror::Error;
pub enum ParserError {
#[error("Lexer error at {file_id}: {error}")]
LexerError { file_id: usize, error: LexerError },
#[error("Unacceptable end of file at {file_id} while {place}")]
UnacceptableEof { file_id: usize, place: &'static str },
#[error("Unexpected token at {file_id}: expected {expected}, saw {token}")]
UnexpectedToken {
file_id: usize,
span: Range<usize>,
token: Token,
expected: &'static str,
},
}
#[derive(Clone, Debug, Error, PartialEq)]