parser: string literal must not be immediately followed by suffix##496
parser: string literal must not be immediately followed by suffix##496Kijewski merged 1 commit intoaskama-rs:masterfrom
suffix##496Conversation
c08749a to
12095e7
Compare
| fn not_suffix_with_hash<'a>(i: &mut &'a str) -> ParseResult<'a, ()> { | ||
| if let Some(suffix) = opt((identifier, '#').take()).parse_next(i)? { | ||
| return Err(winnow::error::ErrMode::Cut(ErrorContext::new( | ||
| "a space is missing to tell suffix and prefix apart", |
There was a problem hiding this comment.
Took me a while to understand this error message. We should mention it's about a string literal and also give an example of what we suggest (between parens (like `r##"" ##`).
There was a problem hiding this comment.
The problem is that we cannot really tell what the user wanted to write, only that somewhere a space is missing. Is it a suffixed string or a prefixed string? I hope that if the user sees the error message they know what they wanted to write. :)
There was a problem hiding this comment.
Well, this message still needs to be improved. Open to suggestions. 😆
There was a problem hiding this comment.
"dear user, what do you even mean by that?"
There was a problem hiding this comment.
Good enough for me me! 🤣
12095e7 to
24544c7
Compare
|
Message is better so let's go. :) |
Resolves https://issues.oss-fuzz.com/issues/426509683.