resinator icon indicating copy to clipboard operation
resinator copied to clipboard

Bad error message for `\"` at the end of a string literal

Open squeek502 opened this issue 1 year ago • 0 comments

Using \" is disallowed as a way to escape " in resinator and gives the error message:

test.rc:1:13: error: escaping quotes with \" is not allowed (use "" instead)
1 RCDATA { "\"" }
            ^~

However, if the \" is at the end of a string literal, then it's likely that the user is trying to insert a literal \ into the string, in which case the error message should look something like this:

test.rc:1:13: error: the escape sequence \" is not allowed (use \\ to escape \, or "" to escape ")
1 RCDATA { "\" }
            ^~

Note that in the Win32 RC compiler, "\" is seen as valid and does parse into \, but we still want to disallow this for preprocessor/compiler confusion reasons (the same reasons as disallowing \" with regards to ")

squeek502 avatar Jul 09 '24 10:07 squeek502