-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
C++ Syntax Misunderstands wchar_t Character Literals #1412
Comments
If you have a PR to resolve this that'd be great. |
@egor-rogov I could probably make a PR for this one, but I'm confused at the single quote syntax... which is shared with Ref:
I don't understand what And do you have any idea why the single quoted one has a possible IE, why wouldn't this work: begin: '(u8?|U|L)?\'', end: '\'', |
@yyyc514 Honestly I have no idea. I guess it reflects the fact that in C/C++ character literal can usually be |
Right, but that would be dealt with by BACKSLASH_ESCAPE (I presume)... this only matches a single
In there a place in the test system for more singular tests about specific features like this? I've mostly just played with the auto-detection tests so far. |
@wyattallen Do single quotes support all the same fancy things that double quotes do? Do you have a quick link or information on the differences so i can make sure I do this as well as possible if I'm going to fix? See above for our current "rules" for this in C++... evidently literal new lines are invalid inside double quoted strings... is that also true for single quoted? |
Sure. |
My pass at this one: Just replaces that insanity with a matching matcher for single quoted strings. It does pass all the tests and should be improved in that previously I don't see how it would have properly detected the end of the string. You could have tricked it with a |
This is merged now! |
When defining a wchar_t character literal (for example
L'#'
) HLJS 9.5.0 gets stuck incorrectly highlighting the following lines as part of a string. Observe the following C++ program.The second
'
inL'#'
starts a string that consumes the remainder of the file. HLJS does not have this problem with the wchar_t string form (for exampleL"#"
).The text was updated successfully, but these errors were encountered: