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

fix(cpp) switch is a keyword #3312

Merged
merged 3 commits into from Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGES.md
@@ -1,7 +1,8 @@
## Version 11.3.0 (most likely)

enh(css/less/stylus/scss) improve consistency of function dispatch (#3301) [Josh Goebel][]
enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][]
- enh(css/less/stylus/scss) improve consistency of function dispatch (#3301) [Josh Goebel][]
- enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][]
- fix(cpp) switch is a keyword (#3312) [Josh Goebel][]
- fix(cpp) fix `xor_eq` keyword highlighting. [Denis Kovalchuk][]
- enh(css/less/stylus/scss) add support for CSS Grid properties [monochromer][]

Expand Down
1 change: 1 addition & 0 deletions src/languages/cpp.js
Expand Up @@ -411,6 +411,7 @@ export default function(hljs) {
/(?!decltype)/,
/(?!if)/,
/(?!for)/,
/(?!switch)/,
/(?!while)/,
hljs.IDENT_RE,
regex.lookahead(/(<[^<>]+>|)\s*\(/))
Expand Down
7 changes: 7 additions & 0 deletions test/markup/cpp/function-like-keywords.expect.txt
@@ -0,0 +1,7 @@
<span class="hljs-keyword">if</span> (ch) {}

<span class="hljs-keyword">switch</span> (ch) {}

<span class="hljs-keyword">while</span> (ch) {}

<span class="hljs-keyword">for</span> (;;) {}
8 changes: 8 additions & 0 deletions test/markup/cpp/function-like-keywords.txt
@@ -0,0 +1,8 @@

if (ch) {}

switch (ch) {}

while (ch) {}

for (;;) {}