-
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) C23's digit separators are highlighted incorrectly #4054
Comments
Does our C++ grammar properly support this already. If so might be an easy port. |
@joshgoebel based on the release over on Stack Overflow, neither C or C++ support the grammar. |
Looks like both C++ and C already have support for digit separators. For example the regex for highlight.js/src/languages/cpp.js Lines 52 to 95 in da79da6
From my understanding the actual issue is that the highlight.js/src/languages/cpp.js Lines 104 to 116 in da79da6
I am not familiar with Highlight.js but my guess is that adding |
I think that would do a bit too much (for some directives), but that's the right idea. I think the pre-processors may need to be handled more precisely... for example |
is this still open |
@joshgoebel upon further inspection #4094 |
Resolved by #4094 |
Describe the issue
C23 has added digit specifiers to the language (
'
, just like C++). They are not highlighted correctly in the code. It seems as if the engine treats it as the start of a string/characterWhich language seems to have the issue?
c
Are you using
highlight
orhighlightAuto
?Whichever one StackExchange uses.
Sample Code to Reproduce
Expected behavior
It should recognize it as a digit separator instead of a character or a string opening quote.
Additional context
This was found at this code review post: https://codereview.stackexchange.com/revisions/292149/6
And it was fixed by such a hack:
The text was updated successfully, but these errors were encountered: