-
Notifications
You must be signed in to change notification settings - Fork 12
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
\0
in a byte string literal does not encode NUL
#348
Comments
Might also apply to |
No, there's no reason apart from me just not knowing that I've never used the escape sequence I have no problem with us adding this escape sequence if it's common enough in other languages that people expect it. |
You can roughly say, if I don't need |
Given the large number of languages where it's present, I'm definitely okay with us adding I also agree with you that we should issue a compilation error when an unknown escape sequence is encountered, in a String or Bytes literal. I'll prepare a quick PR to add that as a compilation error. |
This helps to prevent bugs wherein the user believes they have correctly written an escape code. Prior to this commit, invalid escape code were treated as if they were literal characters, including the backslash character. See discussion in #348
PR #353 adds a nice compilation error on invalid escape characters. I'll leave this ticket open in case you want to do a PR to add |
Currently:
Expected:
Maybe there is good reason for this.
The text was updated successfully, but these errors were encountered: