feat: partially implemented parser

This commit is contained in:
2021-11-29 22:47:39 +01:00
parent 8df8689ca4
commit f05002fc50
6 changed files with 149 additions and 36 deletions

13
src/parser/errors.rs Normal file
View File

@ -0,0 +1,13 @@
use thiserror::Error;
use crate::lexer::errors::LexerErrors;
use crate::lexer::tokens::Token;
#[derive(Debug, Error)]
pub enum ParserErrors {
#[error("unexpected token: {0:?} in procedure {1}")]
UnexpectedTokenError(Token, String),
#[error("input ended prematurely")]
MissingTokenError,
#[error("lexer error")]
LexerError(#[from] LexerErrors),
}