We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the issue C++ std types are highlighted in C sources.
Which language seems to have the issue? C.
C
Are you using highlight or highlightAuto? highlight.
highlight
highlightAuto
Expected behavior C++ std types should't be highlighted in C sources.
Additional context From src/languages/c.js:
src/languages/c.js
const KEYWORDS = { keyword: C_KEYWORDS, type: C_TYPES, literal: 'true false NULL', // TODO: apply hinting work similar to what was done in cpp.js built_in: 'std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream ' + 'auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set ' + 'unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos ' + 'asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp ' + 'fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper ' + 'isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow ' + 'printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp ' + 'strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan ' + 'vfprintf vprintf vsprintf endl initializer_list unique_ptr', };
Why?
The text was updated successfully, but these errors were encountered:
C++ std types should't be highlighted in C sources.
Agree - no doubt left over from when we forked c from the cpp grammar. How many of these would that remove if we cleaned this up?
c
cpp
Sorry, something went wrong.
can this be assigned to me ?
ive added a PR @joshgoebel please review
How many of these would that remove if we cleaned this up?
Would be nice to add all functions and types from https://en.cppreference.com/w/c/header. And support https://en.cppreference.com/w/c/23.
Successfully merging a pull request may close this issue.
Describe the issue
C++ std types are highlighted in C sources.
Which language seems to have the issue?
C
.Are you using
highlight
orhighlightAuto
?highlight.
Expected behavior
C++ std types should't be highlighted in C sources.
Additional context
From
src/languages/c.js
:Why?
The text was updated successfully, but these errors were encountered: