@@ -69,6 +69,20 @@ if !exists("cpp_no_cpp17")
69
69
syn match cppCast " \< reinterpret_pointer_cast\s *$"
70
70
syn match cppFloat display contained " \< 0x\x *\.\x\+ p[-+]\=\d\+\( [FfLl]\| i[fl]\=\| h\| min\| s\| ms\| us\| ns\| _\i *\)\=\> "
71
71
syn match cppFloat display contained " \< 0x\x\+\.\= p[-+]\=\d\+\( [FfLl]\| i[fl]\=\| h\| min\| s\| ms\| us\| ns\| _\i *\)\=\> "
72
+
73
+ " TODO: push this up to c.vim if/when supported in C23
74
+ syn match cppCharacter " u8'[^\\ ]'"
75
+ syn match cppCharacter " u8'[^']*'" contains =cSpecial
76
+ if exists (" c_gnu" )
77
+ syn match cppSpecialError " u8'\\ [^'\" ?\\ abefnrtv]'"
78
+ syn match cppSpecialCharacter " u8'\\ ['\" ?\\ abefnrtv]'"
79
+ else
80
+ syn match cppSpecialError " u8'\\ [^'\" ?\\ abfnrtv]'"
81
+ syn match cppSpecialCharacter " u8'\\ ['\" ?\\ abfnrtv]'"
82
+ endif
83
+ syn match cppSpecialCharacter display " u8'\\\o\{ 1,3}'"
84
+ syn match cppSpecialCharacter display " u8'\\ x\x\+ '"
85
+
72
86
endif
73
87
74
88
" C++ 20 extensions
@@ -89,23 +103,26 @@ endif
89
103
syn match cppMinMax " [<>]?"
90
104
91
105
" Default highlighting
92
- hi def link cppAccess cppStatement
93
- hi def link cppCast cppStatement
106
+ hi def link cppAccess cppStatement
107
+ hi def link cppCast cppStatement
94
108
hi def link cppExceptions Exception
95
- hi def link cppOperator Operator
109
+ hi def link cppOperator Operator
96
110
hi def link cppStatement Statement
97
- hi def link cppModifier Type
98
- hi def link cppType Type
99
- hi def link cppStorageClass StorageClass
111
+ hi def link cppModifier Type
112
+ hi def link cppType Type
113
+ hi def link cppStorageClass StorageClass
100
114
hi def link cppStructure Structure
101
- hi def link cppBoolean Boolean
102
- hi def link cppConstant Constant
115
+ hi def link cppBoolean Boolean
116
+ hi def link cppCharacter cCharacter
117
+ hi def link cppSpecialCharacter cSpecialCharacter
118
+ hi def link cppSpecialError cSpecialError
119
+ hi def link cppConstant Constant
103
120
hi def link cppRawStringDelimiter Delimiter
104
121
hi def link cppRawString String
105
- hi def link cppString String
106
- hi def link cppNumber Number
107
- hi def link cppFloat Number
108
- hi def link cppModule Include
122
+ hi def link cppString String
123
+ hi def link cppNumber Number
124
+ hi def link cppFloat Number
125
+ hi def link cppModule Include
109
126
110
127
let b: current_syntax = " cpp"
111
128
0 commit comments