summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSophie Forrest <git@sophieforrest.com>2024-08-30 23:35:45 +1200
committerSophie Forrest <git@sophieforrest.com>2024-08-30 23:35:45 +1200
commit98d7946709032aae5e1d0d35cff78efc55550900 (patch)
tree70c84ca06187efeef87a01dbfcc0eaf1aeea7c80
parent5126c9ed83fe6169463566e74f966a4a63e57ca0 (diff)
feat(parser): edit diagnostics
-rw-r--r--src/parser.rs10
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