-
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.
Merge pull request #180 from Glyphack/improve-parser-errors
- Loading branch information
Showing
15 changed files
with
899 additions
and
418 deletions.
There are no files selected for viewing
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
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
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,5 +1,5 @@ | ||
pub mod ast; | ||
mod diagnostics; | ||
pub mod error; | ||
mod expression; | ||
mod operator; | ||
pub mod parser; | ||
|
Oops, something went wrong.