-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ParsingError enum for all errors in parser
- Loading branch information
Showing
11 changed files
with
794 additions
and
364 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use miette::Diagnostic; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Diagnostic, Debug)] | ||
pub enum ParsingError { | ||
#[error(transparent)] | ||
#[diagnostic(code(gen_color::io_error))] | ||
IoError(#[from] std::io::Error), | ||
|
||
#[error( | ||
"Invalid syntax" | ||
)] | ||
#[diagnostic(code( | ||
gen_color::colors_and_steps_mismatch | ||
))] | ||
InvalidSyntax { | ||
path: Box<str>, | ||
msg: Box<str>, | ||
line: u32, | ||
#[source_code] | ||
input: String, | ||
#[help] | ||
advice: String, | ||
#[label("span")] | ||
span: (usize, usize), | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
pub mod ast; | ||
pub mod error; | ||
mod diagnostics; | ||
mod expression; | ||
mod operator; | ||
pub mod parser; | ||
|
Oops, something went wrong.