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

(C) C23's digit separators are highlighted incorrectly #4054

Open
Melkor-1 opened this issue May 19, 2024 · 1 comment
Open

(C) C23's digit separators are highlighted incorrectly #4054

Melkor-1 opened this issue May 19, 2024 · 1 comment
Labels
bug help welcome Could use help from community language

Comments

@Melkor-1
Copy link
Contributor

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/character

Which language seems to have the issue?
c

Are you using highlight or highlightAuto?

Whichever one StackExchange uses.

Sample Code to Reproduce

#define _POSIX_C_SOURCE 200'809L
#define _XOPEN_SOURCE   700

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:

#define _POSIX_C_SOURCE 200'809L // '
@Melkor-1 Melkor-1 added bug help welcome Could use help from community language labels May 19, 2024
@joshgoebel
Copy link
Member

Does our C++ grammar properly support this already. If so might be an easy port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
Development

No branches or pull requests

2 participants