Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
squeek502 opened this issue Jul 9, 2024 · 0 comments
Open

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

squeek502 opened this issue Jul 9, 2024 · 0 comments

Comments

@squeek502
Copy link
Owner

squeek502 commented Jul 9, 2024

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 ")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant