-
Notifications
You must be signed in to change notification settings - Fork 499
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
Allow escaping arbitrary characters #2360
Conversation
What do you think about introducing a
Then you would do:
I think this might make the code a little simpler. Also, I think we should see if the error messages from |
Done. It does simplify the code and looks better, thanks for the suggestions!
The syntax we're implementing only accepts up to 6 hex digits, while |
Looking at the error message from I think we should have these errors:
This should allow us to just Sorry for waffling! |
But when In the mean time, pushed a commit trying to find a middle ground, since digging into why |
Compilation error message context is based on tokens, so since a string is one token, by default it points at the whole string. This could definitely be improved. The easiest solution would be to construct a new, fake token which only points at the sub-section of the string containing the invalid escape sequence, but that's probably best left to a follow-up PR. |
Merged! This is great. Tweaked the code a little, plus error messages. |
Nice, I like the tweaks, thanks! Shows a few Rust syntaxes I'm not sufficiently familiar with. |
Closes #2359
Not sure the error reporting is ideal, and not sure if the tests are covering enough cases?