fix code error message not being displayed
This commit is contained in:
parent
8953b347c5
commit
4505def6c0
|
@ -8,7 +8,7 @@ pub enum Error {
|
|||
LexicalError(#[from] crate::lexical::Error),
|
||||
#[error("An error occured while tokenizing the source code.")]
|
||||
TokenizeError(#[from] crate::lexical::token::TokenizeError),
|
||||
#[error("An error occurred while parsing the source code.")]
|
||||
#[error(transparent)]
|
||||
ParseError(#[from] crate::syntax::error::Error),
|
||||
#[error("An error occurred while transpiling the source code.")]
|
||||
TranspileError(#[from] crate::transpile::TranspileError),
|
||||
|
|
|
@ -85,7 +85,7 @@ pub fn parse(
|
|||
|
||||
let mut parser = Parser::new(&tokens);
|
||||
let program = parser.parse_program(handler).ok_or(Error::Other(
|
||||
"An error occured while parsing the source code.",
|
||||
"An error occurred while parsing the source code.",
|
||||
))?;
|
||||
|
||||
if handler.has_received() {
|
||||
|
|
|
@ -87,6 +87,6 @@ impl std::error::Error for UnexpectedSyntax {}
|
|||
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, thiserror::Error)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum Error {
|
||||
#[error("{0}")]
|
||||
#[error(transparent)]
|
||||
UnexpectedSyntax(#[from] UnexpectedSyntax),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue