diff options
| author | Sophie Forrest <git@sophieforrest.com> | 2024-08-30 23:35:45 +1200 |
|---|---|---|
| committer | Sophie Forrest <git@sophieforrest.com> | 2024-08-30 23:35:45 +1200 |
| commit | 98d7946709032aae5e1d0d35cff78efc55550900 (patch) | |
| tree | 70c84ca06187efeef87a01dbfcc0eaf1aeea7c80 | |
| parent | 5126c9ed83fe6169463566e74f966a4a63e57ca0 (diff) | |
feat(parser): edit diagnostics
Diffstat (limited to '')
| -rw-r--r-- | src/parser.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/parser.rs b/src/parser.rs index cffa6db..e639516 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -53,7 +53,10 @@ pub enum Instruction { #[derive(Debug, Diagnostic, Error)] pub enum Error { /// Parser encountered a loop with no beginning. - #[diagnostic(help("try closing the loop"))] + #[diagnostic( + code(brainf_rs::parser::loop_with_no_beginning), + help("try closing the loop") + )] #[error("loop closed at {loop_src:?} has no beginning")] LoopWithNoBeginning { /// Source code associated with diagnostic @@ -66,7 +69,10 @@ pub enum Error { }, /// Parser encountered a loop with no ending. - #[diagnostic(help("try closing the loop"))] + #[diagnostic( + code(brainf_rs::parser::loop_with_no_ending), + help("try closing the loop") + )] #[error("loop beginning at {loop_src:?} has no ending")] LoopWithNoEnding { /// Source code associated with diagnostic |