summary refs log tree commit diff
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-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