fix(c): only match real atomic_* type names, not atomic functions#4446
Open
xianjianlf2 wants to merge 2 commits into
Open
fix(c): only match real atomic_* type names, not atomic functions#4446xianjianlf2 wants to merge 2 commits into
xianjianlf2 wants to merge 2 commits into
Conversation
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +265 B View Changes
|
joshgoebel
reviewed
Jul 19, 2026
Comment on lines
+28
to
+35
| 'bool', 'char', 'schar', 'uchar', 'short', 'ushort', 'int', 'uint', | ||
| 'long', 'ulong', 'llong', 'ullong', | ||
| 'char16_t', 'char32_t', 'wchar_t', | ||
| 'int_least8_t', 'uint_least8_t', 'int_least16_t', 'uint_least16_t', | ||
| 'int_least32_t', 'uint_least32_t', 'int_least64_t', 'uint_least64_t', | ||
| 'int_fast8_t', 'uint_fast8_t', 'int_fast16_t', 'uint_fast16_t', | ||
| 'int_fast32_t', 'uint_fast32_t', 'int_fast64_t', 'uint_fast64_t', | ||
| 'intptr_t', 'uintptr_t', 'size_t', 'ptrdiff_t', 'intmax_t', 'uintmax_t' |
Member
There was a problem hiding this comment.
One item per line please (easier review/diffs in the future). Otherwise looks great, thanks!
Contributor
Author
There was a problem hiding this comment.
Done, split the atomic type list to one item per line.
joshgoebel
requested changes
Jul 19, 2026
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +257 B View Changes
|
The TYPE scope used a wildcard `atomic_[a-z]{3,6}` which mistakenly
highlighted C11 atomic *functions* (atomic_init, atomic_store,
atomic_load, atomic_fetch_add, ...) as types. Replace the wildcard
with an explicit whitelist of the C11 <stdatomic.h> atomic type
names so only real atomic types are highlighted.
Closes highlightjs#3837
xianjianlf2
force-pushed
the
fix/c-atomic-types-3837
branch
from
July 20, 2026 06:29
b194618 to
0e684dd
Compare
Build Size ReportChanges to minified artifacts in 4 files changedTotal change +258 B View Changes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Resolves #3837.
The C grammar's
atomic_[a-z]{0,6}[kmgtptme]?wildcard rule was matching atomic function names (atomic_init,atomic_load,atomic_store, …) as types. Per the issue discussion, this replaces the wildcard with an explicit whitelist of the real<stdatomic.h>type names (atomic_bool,atomic_int,atomic_char32_t, etc.), so functions likeatomic_init(...)are no longer mis-highlighted as types while all genuine atomic types keep theirtypescope.New markup test
test/markup/c/atomic-typescovers both sides: every whitelisted type highlights astype, and atomic function calls do not.Checklist
test/markup/c/atomic-types.txt/.expect.txt)npm run build+mocha test/markup— 546 passing