From ce1e4d83b96b4dea0080a9c09b40a1ddb31e80f1 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 24 Mar 2024 20:03:58 +0100 Subject: [PATCH] fix(parser/lexing/error): Improve the message of the `NoMatchesTaken` error This error should only ever be raised, when we encountered a bug. This change notifies the user, that the situation is rather likely to be a bug and that this should be reported. --- trixy-parser/src/lexing/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trixy-parser/src/lexing/error.rs b/trixy-parser/src/lexing/error.rs index fe81f1b..c9bcf54 100644 --- a/trixy-parser/src/lexing/error.rs +++ b/trixy-parser/src/lexing/error.rs @@ -41,7 +41,7 @@ pub enum LexingError { impl AdditionalHelp for LexingError { fn additional_help(&self) -> String { match self { - LexingError::NoMatchesTaken => "This token does not produce a possible match".to_owned(), + LexingError::NoMatchesTaken => "This is probably a bug, please open an issue at the issue tracker".to_owned(), LexingError::UnexpectedEOF => "This eof was completely unexpected".to_owned(), LexingError::ExpectedArrow => "The `-` token is interpretet as a started arrow (`->`), but we could not find the arrow tip (`>`)".to_owned(), LexingError::UnknownCharacter(char) => {