Skip to content

Commit e4226f5

Browse files
authored
fix(cpp) switch is a keyword (#3312)
1 parent 51d4c1b commit e4226f5

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

CHANGES.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Version 11.3.0 (most likely)
22

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

src/languages/cpp.js

+1
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ export default function(hljs) {
411411
/(?!decltype)/,
412412
/(?!if)/,
413413
/(?!for)/,
414+
/(?!switch)/,
414415
/(?!while)/,
415416
hljs.IDENT_RE,
416417
regex.lookahead(/(<[^<>]+>|)\s*\(/))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<span class="hljs-keyword">if</span> (ch) {}
2+
3+
<span class="hljs-keyword">switch</span> (ch) {}
4+
5+
<span class="hljs-keyword">while</span> (ch) {}
6+
7+
<span class="hljs-keyword">for</span> (;;) {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
if (ch) {}
3+
4+
switch (ch) {}
5+
6+
while (ch) {}
7+
8+
for (;;) {}

0 commit comments

Comments
 (0)