| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY int "(?:[0-9](?:'?[0-9]++)*+)"> |
| 5 |
<!ENTITY hex_int "(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f]++)*+)"> |
| 6 |
<!ENTITY exp_float "(?:[eE][+-]?∫)"> |
| 7 |
<!ENTITY exp_hexfloat "(?:[pP][-+]?∫)"> |
| 8 |
|
| 9 |
<!ENTITY separators ",;"> |
| 10 |
<!ENTITY ns_punctuators "(){}[].+-/*%=<>!|&?~^"> |
| 11 |
<!ENTITY punctuators ":&ns_punctuators;"> |
| 12 |
|
| 13 |
<!-- printf-like format strings conversion specifiers --> |
| 14 |
<!ENTITY printf_like "%[-+ #0]*+(?:[0-9]++|\*)?(?:\.(?:[0-9]++|\*))?(?:(?:hh|ll|[hljzt]|wf?(?:8|16|32|64))?[dioxXubn]|(?:DD|[lLHD])?[fFeEaAgG]|l?[cs]|[p%])"> |
| 15 |
<!-- https://en.cppreference.com/w/cpp/utility/format/formatter#Standard_format_specification --> |
| 16 |
<!ENTITY format_like "\{\{|\}\}|\{[0-9]*(?::(?:[^{}]?[<>^])?[-+ #0]*(?:[0-9]+|\{[0-9]*\})?(?:\.(?:[0-9]+|\{[0-9]*\}))?L?[sbBcdoxXaAeEfFgGp]?)?\}"> |
| 17 |
|
| 18 |
<!ENTITY ispphash "(?:#|%\:|\?\?=)"> |
| 19 |
<!ENTITY pphash "&ispphash;\s*"> |
| 20 |
<!ENTITY ppemptypp "($|(?=(/\*([^*]|\*[^/])*\*/\s*)?(//.*)?$))"> |
| 21 |
<!ENTITY ppcond0 "\s+(?:0|false)\s*&ppemptypp;"> |
| 22 |
<!ENTITY ppcond1 "\s+(?:1|true)\s*(\|\|([^/]|/[^*/])+)?&ppemptypp;"> |
| 23 |
|
| 24 |
<!ENTITY ident_internal1 "_[a-zA-Z0-9_]+"> |
| 25 |
<!ENTITY ident_internal2 "[a-zA-Z][a-zA-Z0-9_]*__\b"> |
| 26 |
<!ENTITY ident_internal "(?:&ident_internal1;|&ident_internal2;)"> |
| 27 |
<!ENTITY ident_member1 "m_[a-zA-Z0-9_]+"> |
| 28 |
<!ENTITY ident_member2 "[a-z][a-zA-Z0-9_]*_\b"> |
| 29 |
<!ENTITY ident_member "(?:&ident_member1;|&ident_member2;)"> |
| 30 |
<!ENTITY ident_CONST "[A-Z][A-Z0-9_]{2,}\b"> |
| 31 |
<!ENTITY ident_type "[a-zA-Z][a-zA-Z0-9_]*_t(?:ype)?\b"> |
| 32 |
<!ENTITY ident_global "g_[a-zA-Z0-9_]+"> |
| 33 |
<!ENTITY ident_static_prefix "s_[a-zA-Z0-9_]"> |
| 34 |
]> |
| 35 |
<language |
| 36 |
name="ISO C++" |
| 37 |
section="Sources" |
| 38 |
version="28" |
| 39 |
kateversion="5.79" |
| 40 |
indenter="cstyle" |
| 41 |
style="C++" |
| 42 |
mimetype="text/x-c++src;text/x-c++hdr;text/x-chdr" |
| 43 |
extensions="*.c++;*.cxx;*.cpp;*.cc;*.C;*.h;*.hh;*.H;*.h++;*.hxx;*.hpp;*.hcc;*.moc" |
| 44 |
author="Alex Turbov ([email protected])" |
| 45 |
license="LGPL" |
| 46 |
priority="6" |
| 47 |
> |
| 48 |
<!-- |
| 49 |
Complete list of changes by Alex Turbov ([email protected]) |
| 50 |
can be found at: |
| 51 |
http://kde-files.org/content/show.php?content=90660 |
| 52 |
--> |
| 53 |
<highlighting> |
| 54 |
<!-- https://en.cppreference.com/w/cpp/keyword --> |
| 55 |
<list name="controlflow"> |
| 56 |
<item>break</item> |
| 57 |
<item>case</item> |
| 58 |
<item>catch</item> |
| 59 |
<item>continue</item> |
| 60 |
<item>default</item> |
| 61 |
<item>do</item> |
| 62 |
<item>else</item> |
| 63 |
<item>for</item> |
| 64 |
<item>goto</item> |
| 65 |
<item>if</item> |
| 66 |
<item>return</item> |
| 67 |
<item>switch</item> |
| 68 |
<item>throw</item> |
| 69 |
<item>try</item> |
| 70 |
<item>while</item> |
| 71 |
<!-- coroutine --> |
| 72 |
<item>co_await</item> |
| 73 |
<item>co_return</item> |
| 74 |
<item>co_yield</item> |
| 75 |
</list> |
| 76 |
|
| 77 |
<!-- https://en.cppreference.com/w/cpp/keyword --> |
| 78 |
<list name="keywords"> |
| 79 |
<item>alignof</item> |
| 80 |
<item>alignas</item> |
| 81 |
<item>asm</item> |
| 82 |
<item>auto</item> |
| 83 |
<item>class</item> |
| 84 |
<item>consteval</item> <!-- C++20 --> |
| 85 |
<item>constinit</item> <!-- C++20 --> |
| 86 |
<item>constexpr</item> <!-- C++11 --> |
| 87 |
<item>const_cast</item> |
| 88 |
<item>decltype</item> |
| 89 |
<item>delete</item> |
| 90 |
<item>dynamic_cast</item> |
| 91 |
<item>enum</item> |
| 92 |
<item>explicit</item> |
| 93 |
<item>false</item> |
| 94 |
<item>final</item> <!-- C++11 --> |
| 95 |
<item>friend</item> |
| 96 |
<item>inline</item> |
| 97 |
<item>namespace</item> |
| 98 |
<item>new</item> |
| 99 |
<item>noexcept</item> |
| 100 |
<item>nullptr</item> |
| 101 |
<item>operator</item> |
| 102 |
<item>override</item> <!-- C++11 --> |
| 103 |
<item>private</item> |
| 104 |
<item>protected</item> |
| 105 |
<item>public</item> |
| 106 |
<item>reinterpret_cast</item> |
| 107 |
<item>sizeof</item> |
| 108 |
<item>static_assert</item> |
| 109 |
<item>static_cast</item> |
| 110 |
<item>struct</item> |
| 111 |
<item>template</item> |
| 112 |
<item>this</item> |
| 113 |
<item>true</item> |
| 114 |
<item>typedef</item> |
| 115 |
<item>typeid</item> |
| 116 |
<item>typename</item> |
| 117 |
<item>union</item> |
| 118 |
<item>using</item> |
| 119 |
<item>virtual</item> |
| 120 |
<!-- Alternative operators (see 2.12) --> |
| 121 |
<item>and</item> |
| 122 |
<item>and_eq</item> |
| 123 |
<item>bitand</item> |
| 124 |
<item>bitor</item> |
| 125 |
<item>compl</item> |
| 126 |
<item>not</item> |
| 127 |
<item>not_eq</item> |
| 128 |
<item>or</item> |
| 129 |
<item>or_eq</item> |
| 130 |
<item>xor</item> |
| 131 |
<item>xor_eq</item> |
| 132 |
<!-- Concept --> |
| 133 |
<item>concept</item> |
| 134 |
<item>requires</item> |
| 135 |
<!-- TM TS --> |
| 136 |
<!-- <item>atomic_cancel</item> |
| 137 |
<item>atomic_commit</item> |
| 138 |
<item>atomic_noexcept</item> |
| 139 |
<item>synchronized</item> |
| 140 |
<item>transaction_safe</item> |
| 141 |
<item>transaction_safe_dynamic</item> --> |
| 142 |
<!-- module --> |
| 143 |
<item>import</item> |
| 144 |
<item>module</item> |
| 145 |
<item>export</item> <!-- Unused but reserved, keyword since c++20 --> |
| 146 |
<!-- reflexion TS --> |
| 147 |
<!-- <item>reflexpr</item> --> |
| 148 |
</list> |
| 149 |
|
| 150 |
<!-- 7.6 Attributes --> |
| 151 |
<!-- http://en.cppreference.com/w/cpp/language/attributes --> |
| 152 |
<list name="attributes"> |
| 153 |
<!-- C++11 --> |
| 154 |
<item>noreturn</item> |
| 155 |
<item>carries_dependency</item> |
| 156 |
<!-- C++14 --> |
| 157 |
<item>deprecated</item> |
| 158 |
<!-- C++17 --> |
| 159 |
<item>fallthrough</item> |
| 160 |
<item>nodiscard</item> |
| 161 |
<item>maybe_unused</item> |
| 162 |
<!-- C++20 --> |
| 163 |
<item>likely</item> |
| 164 |
<item>unlikely</item> |
| 165 |
<item>no_unique_address</item> |
| 166 |
<!-- C++23 --> |
| 167 |
<item>assume</item> |
| 168 |
<!-- TM TS --> |
| 169 |
<!-- <item>optimize_for_synchronized</item> --> |
| 170 |
</list> |
| 171 |
|
| 172 |
<!-- https://en.cppreference.com/w/cpp/keyword --> |
| 173 |
<!-- https://en.cppreference.com/w/cpp/types/integer --> |
| 174 |
<list name="types"> |
| 175 |
<item>bool</item> |
| 176 |
<item>char</item> |
| 177 |
<item>char8_t</item> <!-- C++20 --> |
| 178 |
<item>char16_t</item> |
| 179 |
<item>char32_t</item> |
| 180 |
<item>double</item> |
| 181 |
<item>float</item> |
| 182 |
<item>int</item> |
| 183 |
<item>long</item> |
| 184 |
<item>short</item> |
| 185 |
<item>signed</item> |
| 186 |
<item>unsigned</item> |
| 187 |
<item>void</item> |
| 188 |
<item>int8_t</item> |
| 189 |
<item>int16_t</item> |
| 190 |
<item>int32_t</item> |
| 191 |
<item>int64_t</item> |
| 192 |
<item>uint8_t</item> |
| 193 |
<item>uint16_t</item> |
| 194 |
<item>uint32_t</item> |
| 195 |
<item>uint64_t</item> |
| 196 |
<item>int_least8_t</item> |
| 197 |
<item>int_least16_t</item> |
| 198 |
<item>int_least32_t</item> |
| 199 |
<item>int_least64_t</item> |
| 200 |
<item>uint_least8_t</item> |
| 201 |
<item>uint_least16_t</item> |
| 202 |
<item>uint_least32_t</item> |
| 203 |
<item>uint_least64_t</item> |
| 204 |
<item>int_fast8_t</item> |
| 205 |
<item>int_fast16_t</item> |
| 206 |
<item>int_fast32_t</item> |
| 207 |
<item>int_fast64_t</item> |
| 208 |
<item>uint_fast8_t</item> |
| 209 |
<item>uint_fast16_t</item> |
| 210 |
<item>uint_fast32_t</item> |
| 211 |
<item>uint_fast64_t</item> |
| 212 |
<item>size_t</item> |
| 213 |
<item>ssize_t</item> |
| 214 |
<item>wchar_t</item> |
| 215 |
<item>intptr_t</item> |
| 216 |
<item>uintptr_t</item> |
| 217 |
<item>intmax_t</item> |
| 218 |
<item>uintmax_t</item> |
| 219 |
<item>ptrdiff_t</item> |
| 220 |
<item>sig_atomic_t</item> |
| 221 |
<item>wint_t</item> |
| 222 |
<item>va_list</item> |
| 223 |
<item>FILE</item> |
| 224 |
<item>fpos_t</item> |
| 225 |
<item>time_t</item> |
| 226 |
</list> |
| 227 |
<list name="modifiers"> |
| 228 |
<item>const</item> |
| 229 |
<item>extern</item> |
| 230 |
<item>mutable</item> |
| 231 |
<item>register</item> <!-- The keyword is unused and reserved (c++17) --> |
| 232 |
<item>static</item> |
| 233 |
<item>thread_local</item> |
| 234 |
<item>volatile</item> |
| 235 |
</list> |
| 236 |
<!-- http://en.cppreference.com/w/cpp/preprocessor/replace --> |
| 237 |
<list name="StdMacros"> |
| 238 |
<item>__DATE__</item> |
| 239 |
<item>__FILE__</item> |
| 240 |
<item>__LINE__</item> |
| 241 |
<item>__STDCPP_DEFAULT_NEW_ALIGNMENT__</item> |
| 242 |
<item>__STDCPP_STRICT_POINTER_SAFETY__</item> |
| 243 |
<item>__STDCPP_THREADS__</item> |
| 244 |
<item>__STDC_HOSTED__</item> |
| 245 |
<item>__STDC_ISO_10646__</item> |
| 246 |
<item>__STDC_MB_MIGHT_NEQ_WC__</item> |
| 247 |
<item>__STDC_VERSION__</item> |
| 248 |
<item>__STDC__</item> |
| 249 |
<item>__TIME__</item> |
| 250 |
<item>__cplusplus</item> |
| 251 |
<item>__func__</item> |
| 252 |
<item>assert</item> |
| 253 |
<item>_Pragma</item> |
| 254 |
<!-- C++17 --> |
| 255 |
<item>__has_include</item> |
| 256 |
<!-- C++20 --> |
| 257 |
<item>__has_cpp_attribute</item> |
| 258 |
</list> |
| 259 |
<list name="InMacro"> |
| 260 |
<item>__VA_ARGS__</item> |
| 261 |
<item>__VA_OPT__</item> |
| 262 |
</list> |
| 263 |
<list name="preprocessor"> |
| 264 |
<item>if</item> |
| 265 |
<item>ifdef</item> |
| 266 |
<item>ifndef</item> |
| 267 |
<item>elif</item> |
| 268 |
<item>elifdef</item> <!--C++23--> |
| 269 |
<item>elifndef</item> <!--C++23--> |
| 270 |
<item>else</item> |
| 271 |
<item>endif</item> |
| 272 |
<item>cmakedefine01</item> |
| 273 |
<item>cmakedefine</item> |
| 274 |
<item>define</item> |
| 275 |
<item>include</item> |
| 276 |
<item>error</item> |
| 277 |
<item>line</item> |
| 278 |
<item>pragma</item> |
| 279 |
<item>undef</item> |
| 280 |
<item>warning</item> |
| 281 |
</list> |
| 282 |
<list name="preprocessorDefine"> |
| 283 |
<item>cmakedefine01</item> |
| 284 |
<item>cmakedefine</item> |
| 285 |
<item>define</item> |
| 286 |
<item>undef</item> |
| 287 |
</list> |
| 288 |
<list name="preprocessorOther"> |
| 289 |
<item>error</item> |
| 290 |
<item>line</item> |
| 291 |
<item>pragma</item> |
| 292 |
<item>warning</item> |
| 293 |
</list> |
| 294 |
|
| 295 |
<contexts> |
| 296 |
<context name="Main" attribute="Normal Text" lineEndContext="#stay"> |
| 297 |
<DetectSpaces/> |
| 298 |
<!-- Match punctuators (partial for fast path) --> |
| 299 |
<AnyChar attribute="Symbol" context="#stay" String=":()]+-*=>!|&~^" /> |
| 300 |
<AnyChar attribute="Separator Symbol" context="#stay" String="&separators;" /> |
| 301 |
<!-- Match scope regions --> |
| 302 |
<DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" /> |
| 303 |
<DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" /> |
| 304 |
<Detect2Chars attribute="Symbol" context="#stay" char="<" char1="%" beginRegion="Brace1" /> <!-- Digraph: { --> |
| 305 |
<Detect2Chars attribute="Symbol" context="#stay" char="%" char1=">" endRegion="Brace1" /> <!-- Digraph: } --> |
| 306 |
<!-- Detect attributes --> |
| 307 |
<Detect2Chars attribute="Symbol" context="Attribute" char="[" char1="[" /> |
| 308 |
<StringDetect attribute="Symbol" context="Attribute" String="<:<:" /> <!-- Digraph: [[ --> |
| 309 |
|
| 310 |
<!-- Match preprocessor directives --> |
| 311 |
<DetectChar attribute="Preprocessor" context="AfterHash" char="#" lookAhead="1"/> |
| 312 |
<Detect2Chars attribute="Preprocessor" context="AfterHash" char="%" char1=":" lookAhead="1"/> <!-- Digraph: # --> |
| 313 |
<StringDetect attribute="Preprocessor" context="AfterHash" String="??=" lookAhead="1"/> <!-- Trigraph: # --> |
| 314 |
|
| 315 |
<!-- Match numbers --> |
| 316 |
<RegExpr context="Number" String="\.?[0-9]" lookAhead="true" /> |
| 317 |
<!-- Match comments --> |
| 318 |
<IncludeRules context="match comments and region markers" /> |
| 319 |
<!-- Match punctuators --> |
| 320 |
<AnyChar attribute="Symbol" context="#stay" String="&punctuators;" /> |
| 321 |
<!-- Match keywords --> |
| 322 |
<IncludeRules context="match keywords" /> |
| 323 |
<!-- Match string literals --> |
| 324 |
<AnyChar context="SelectString" String="UuLR"'" lookAhead="1"/> |
| 325 |
<!-- Match GCC extensions --> |
| 326 |
<IncludeRules context="DetectGccExtensions##GCCExtensions" /> |
| 327 |
<!-- Match most used namespaces and styles --> |
| 328 |
<RegExpr context="DispatchNamespace" String="(std::)|(boost::|BOOST_)|details?::|aux::|internals::" lookAhead="1"/> |
| 329 |
<IncludeRules context="match identifier" /> |
| 330 |
<!-- Match invalid symbols --> |
| 331 |
<AnyChar attribute="Error" context="#stay" String="$@`" /> |
| 332 |
</context> |
| 333 |
|
| 334 |
<context name="match comments" attribute="Normal Text" lineEndContext="#pop"> |
| 335 |
<Detect2Chars attribute="Comment" context="MatchComment" char="/" char1="/" lookAhead="true"/> |
| 336 |
<Detect2Chars attribute="Comment" context="MatchComment" char="/" char1="*" lookAhead="true" /> |
| 337 |
</context> |
| 338 |
|
| 339 |
<context name="MatchComment" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 340 |
<IncludeRules context="##Doxygen" /> |
| 341 |
<Detect2Chars attribute="Comment" context="#pop!Comment 1" char="/" char1="/" /> |
| 342 |
<Detect2Chars attribute="Comment" context="#pop!Comment 2" char="/" char1="*" beginRegion="Comment" /> |
| 343 |
</context> |
| 344 |
|
| 345 |
<context name="match comments and region markers" attribute="Normal Text" lineEndContext="#pop"> |
| 346 |
<Detect2Chars attribute="Comment" context="MatchCommentAndRegionMarkers" char="/" char1="/" lookAhead="true"/> |
| 347 |
<Detect2Chars attribute="Comment" context="MatchCommentAndRegionMarkers" char="/" char1="*" lookAhead="true" /> |
| 348 |
</context> |
| 349 |
|
| 350 |
<context name="MatchCommentAndRegionMarkers" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 351 |
<StringDetect attribute="Region Marker" context="#pop!Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" /> |
| 352 |
<StringDetect attribute="Region Marker" context="#pop!Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" /> |
| 353 |
<IncludeRules context="MatchComment" /> |
| 354 |
</context> |
| 355 |
|
| 356 |
<context name="match keywords" attribute="Normal Text" lineEndContext="#pop"> |
| 357 |
<WordDetect attribute="Keyword" context="CheckUDLOperator" String="operator" /> |
| 358 |
<keyword attribute="Control Flow" context="#stay" String="controlflow" /> |
| 359 |
<keyword attribute="Keyword" context="#stay" String="keywords" /> |
| 360 |
</context> |
| 361 |
|
| 362 |
|
| 363 |
<context name="SelectStringPP" attribute="Preprocessor" lineEndContext="#pop"> |
| 364 |
<IncludeRules context="SelectString"/> |
| 365 |
</context> |
| 366 |
<context name="SelectString" attribute="Normal Text" lineEndContext="#pop"> |
| 367 |
<DetectChar attribute="String" context="#pop!String8" char="""/> |
| 368 |
<DetectChar attribute="Char" context="#pop!Char8" char="'"/> |
| 369 |
<Detect2Chars context="#pop!SelectStringPrefix" char="U" char1=""" lookAhead="1"/> |
| 370 |
<Detect2Chars context="#pop!SelectStringPrefix" char="u" char1=""" lookAhead="1"/> |
| 371 |
<Detect2Chars context="#pop!SelectStringPrefix" char="L" char1=""" lookAhead="1"/> |
| 372 |
<StringDetect context="#pop!SelectStringPrefix" String="u8"" lookAhead="1"/> |
| 373 |
<Detect2Chars attribute="Raw String Delimiter" context="#pop!RawString" char="R" char1=""" /> |
| 374 |
<StringDetect attribute="Raw String Delimiter" context="#pop!RawString" String="uR""/> |
| 375 |
<StringDetect attribute="Raw String Delimiter" context="#pop!RawString" String="UR""/> |
| 376 |
<StringDetect attribute="Raw String Delimiter" context="#pop!RawString" String="LR""/> |
| 377 |
<StringDetect attribute="Raw String Delimiter" context="#pop!RawString" String="u8R""/> |
| 378 |
<Detect2Chars context="#pop!SelectCharPrefix" char="U" char1="'" lookAhead="1"/> |
| 379 |
<Detect2Chars context="#pop!SelectCharPrefix" char="u" char1="'" lookAhead="1"/> |
| 380 |
<Detect2Chars context="#pop!SelectCharPrefix" char="L" char1="'" lookAhead="1"/> |
| 381 |
<StringDetect context="#pop!SelectCharPrefix" String="u8'" lookAhead="1"/> |
| 382 |
|
| 383 |
<!-- match identifier --> |
| 384 |
<keyword attribute="Data Type" context="#pop" String="types"/> |
| 385 |
<RegExpr context="#pop!DispatchIdentifier" String="(&ident_internal2;)|(&ident_member2;)|(&ident_CONST;)|(&ident_type;)" lookAhead="1"/> |
| 386 |
<DetectIdentifier context="#pop"/> |
| 387 |
</context> |
| 388 |
|
| 389 |
<context name="SelectStringPrefix" attribute="String" lineEndContext="#pop"> |
| 390 |
<Detect2Chars attribute="String Literal Prefix" context="#pop!StringPrefix8" char="u" char1="8"/> |
| 391 |
<AnyChar attribute="String Literal Prefix" context="#pop!StringPrefix16" String="uL"/> |
| 392 |
<DetectChar attribute="String Literal Prefix" context="#pop!StringPrefix32" char="U"/> |
| 393 |
</context> |
| 394 |
<context name="StringPrefix8" attribute="String" lineEndContext="#pop"> |
| 395 |
<DetectChar attribute="String" context="#pop!String8" char="""/> |
| 396 |
</context> |
| 397 |
<context name="StringPrefix16" attribute="String" lineEndContext="#pop"> |
| 398 |
<DetectChar attribute="String" context="#pop!String16" char="""/> |
| 399 |
</context> |
| 400 |
<context name="StringPrefix32" attribute="String" lineEndContext="#pop"> |
| 401 |
<DetectChar attribute="String" context="#pop!String32" char="""/> |
| 402 |
</context> |
| 403 |
|
| 404 |
<context name="SelectCharPrefix" attribute="String" lineEndContext="#pop"> |
| 405 |
<Detect2Chars attribute="Char Literal Prefix" context="#pop!CharPrefix8" char="u" char1="8"/> |
| 406 |
<AnyChar attribute="Char Literal Prefix" context="#pop!CharPrefix16" String="uL"/> |
| 407 |
<DetectChar attribute="Char Literal Prefix" context="#pop!CharPrefix32" char="U"/> |
| 408 |
</context> |
| 409 |
<context name="CharPrefix8" attribute="Char" lineEndContext="#pop"> |
| 410 |
<DetectChar attribute="Char" context="#pop!Char8" char="'"/> |
| 411 |
</context> |
| 412 |
<context name="CharPrefix16" attribute="Char" lineEndContext="#pop"> |
| 413 |
<DetectChar attribute="Char" context="#pop!Char16" char="'"/> |
| 414 |
</context> |
| 415 |
<context name="CharPrefix32" attribute="Char" lineEndContext="#pop"> |
| 416 |
<DetectChar attribute="Char" context="#pop!Char32" char="'"/> |
| 417 |
</context> |
| 418 |
|
| 419 |
<context name="match identifier" attribute="Normal Text" lineEndContext="#pop"> |
| 420 |
<keyword attribute="Data Type" context="#stay" String="types" /> |
| 421 |
<keyword attribute="Type Modifiers" context="#stay" String="modifiers" /> |
| 422 |
<keyword attribute="Standard Macros" context="#stay" String="StdMacros" /> |
| 423 |
<RegExpr context="DispatchIdentifier" String="(&ident_internal;)|(&ident_member;)|(&ident_CONST;)|(&ident_type;)|(&ident_global;)|&ident_static_prefix;" lookAhead="1"/> |
| 424 |
<DetectIdentifier /> |
| 425 |
</context> |
| 426 |
<context name="DispatchIdentifier" attribute="Normal Text" lineEndContext="#pop"> |
| 427 |
<StringDetect context="#pop" String="%2" dynamic="1" attribute="Data Members (m_*)"/> |
| 428 |
<StringDetect context="#pop" String="%4" dynamic="1" attribute="Types (*_t/*_type)"/> |
| 429 |
<StringDetect context="#pop" String="%3" dynamic="1" attribute="CONSTS/MACROS"/> |
| 430 |
<StringDetect context="#pop" String="%1" dynamic="1" attribute="Internals"/> |
| 431 |
<StringDetect context="#pop" String="%5" dynamic="1" attribute="Globals (g_*)"/> |
| 432 |
<DetectIdentifier context="#pop" attribute="Statics (s_*)"/> |
| 433 |
</context> |
| 434 |
|
| 435 |
<context name="DispatchNamespace" attribute="Normal Text" lineEndContext="#pop"> |
| 436 |
<StringDetect context="#pop!Standard Classes" String="%1" dynamic="1" attribute="Standard Classes"/> |
| 437 |
<StringDetect context="#pop!Boost Stuff" String="%2" dynamic="1" attribute="Boost Stuff"/> |
| 438 |
<DetectIdentifier context="#pop!InternalsNS" attribute="Internals"/> |
| 439 |
</context> |
| 440 |
|
| 441 |
<context name="DispatchNamespacePP" attribute="Preprocessor" lineEndContext="#pop"> |
| 442 |
<StringDetect context="#pop!Standard Classes In PP" String="%1" dynamic="1" attribute="Standard Classes"/> |
| 443 |
<StringDetect context="#pop!Boost Stuff In PP" String="%2" dynamic="1" attribute="Boost Stuff"/> |
| 444 |
<DetectIdentifier context="#pop!InternalsNS In PP" attribute="Internals"/> |
| 445 |
</context> |
| 446 |
|
| 447 |
<context name="Number" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 448 |
<WordDetect attribute="Decimal" context="IntSuffix" String="0" weakDeliminator="."/> |
| 449 |
<RegExpr attribute="Float" context="FloatSuffix" String="\.∫&exp_float;?|0[xX](?:\.&hex_int;&exp_hexfloat;?|&hex_int;(?:&exp_hexfloat;|\.&hex_int;?&exp_hexfloat;?))|∫(?:&exp_float;|\.∫?&exp_float;?)" /> |
| 450 |
<IncludeRules context="Integer" /> |
| 451 |
</context> |
| 452 |
|
| 453 |
<context name="Integer" attribute="Normal Text" lineEndContext="#pop"> |
| 454 |
<DetectChar context="#pop!IntStartsWith0" char="0" lookAhead="1"/> |
| 455 |
<RegExpr attribute="Decimal" context="IntSuffix" String="∫" /> |
| 456 |
<RegExpr attribute="Error" context="#pop" String="[._0-9A-Za-z']++" /> |
| 457 |
</context> |
| 458 |
<context name="IntStartsWith0" attribute="Normal Text" lineEndContext="#pop"> |
| 459 |
<RegExpr attribute="Hex" context="IntSuffix" String="0[xX]&hex_int;" /> |
| 460 |
<RegExpr attribute="Binary" context="IntSuffix" String="0[Bb][01](?:'?[01]++)*+" /> |
| 461 |
<RegExpr attribute="Octal" context="IntSuffix" String="0(?:'?[0-7]++)++" /> |
| 462 |
<DetectChar attribute="Decimal" context="IntSuffix" char="0"/> |
| 463 |
</context> |
| 464 |
|
| 465 |
<context name="IntSuffix" attribute="Error" lineEndContext="#pop#pop" fallthroughContext="NumericSuffixError"> |
| 466 |
<DetectChar attribute="Error" context="#stay" char="'" /> |
| 467 |
<AnyChar context="#pop!IntSuffixPattern" String="uUlLzZimunshyd_" lookAhead="1"/> |
| 468 |
</context> |
| 469 |
|
| 470 |
<context name="IntSuffixPattern" attribute="Error" lineEndContext="#pop#pop" fallthroughContext="NumericSuffixError"> |
| 471 |
<!-- https://en.cppreference.com/w/cpp/language/integer_literal#The_type_of_the_literal --> |
| 472 |
<RegExpr attribute="Standard Suffix" context="NumericSuffixError" String="([Uu](LL?|ll?|[Zz])?|(LL?|ll?|[Zz])[Uu]?)\b"/> |
| 473 |
<!-- https://en.cppreference.com/w/cpp/language/user_literal#Standard_library --> |
| 474 |
<RegExpr attribute="Standard Classes" context="NumericSuffixError" String="(?:i[fl]?|min|[mun]?s|[hyd])\b"/> |
| 475 |
<DetectChar context="#pop!NumericUserSuffixPattern" char="_" lookAhead="1"/> |
| 476 |
</context> |
| 477 |
|
| 478 |
<context name="FloatSuffix" attribute="Error" lineEndContext="#pop#pop" fallthroughContext="NumericSuffixError"> |
| 479 |
<DetectChar attribute="Error" context="#stay" char="'" /> |
| 480 |
<AnyChar context="#pop!FloatSuffixPattern" String="fFlLimsh_" lookAhead="1"/> |
| 481 |
</context> |
| 482 |
|
| 483 |
<context name="FloatSuffixPattern" attribute="Error" lineEndContext="#pop#pop" fallthroughContext="NumericSuffixError"> |
| 484 |
<!-- https://en.cppreference.com/w/cpp/language/floating_literal#Syntax --> |
| 485 |
<AnyChar attribute="Standard Suffix" context="NumericSuffixError" String="fFlL" /> |
| 486 |
<!-- https://en.cppreference.com/w/cpp/language/user_literal#Standard_library --> |
| 487 |
<RegExpr attribute="Standard Classes" context="NumericSuffixError" String="(?:i[fl]?|min|[mun]?s|h)\b" /> |
| 488 |
<DetectChar context="#pop!NumericUserSuffixPattern" char="_" lookAhead="1" /> |
| 489 |
</context> |
| 490 |
|
| 491 |
<context name="NumericUserSuffixPattern" attribute="Error" lineEndContext="#pop#pop"> |
| 492 |
<!-- |
| 493 |
http://en.cppreference.com/w/cpp/language/user_literal#Notes |
| 494 |
Due to maximal munch, user-defined integer and floating point literals ending in |
| 495 |
p, P, (since C++17) e and E, when followed by the operators + or -, |
| 496 |
must be separated from the operator with whitespace or parentheses in the source |
| 497 |
--> |
| 498 |
<RegExpr attribute="Error" context="#pop#pop" String="_[eEpP][+-]" /> |
| 499 |
<DetectIdentifier attribute="UDL Numeric Suffix" context="NumericSuffixError"/> |
| 500 |
</context> |
| 501 |
|
| 502 |
<context name="NumericSuffixError" attribute="Error" lineEndContext="#pop#pop#pop" fallthroughContext="#pop#pop#pop"> |
| 503 |
<AnyChar attribute="Error" String=".'0123456789"/> |
| 504 |
<DetectIdentifier attribute="Error"/> |
| 505 |
</context> |
| 506 |
|
| 507 |
<context name="CheckUDLOperator" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 508 |
<DetectSpaces /> |
| 509 |
<Detect2Chars attribute="String" context="UDLOperatorName" char=""" char1=""" /> |
| 510 |
</context> |
| 511 |
|
| 512 |
<context name="UDLOperatorName" attribute="Normal Text" lineEndContext="#stay" fallthroughContext="#pop!IdentifierError"> |
| 513 |
<DetectSpaces /> |
| 514 |
<RegExpr attribute="Normal Text" context="#pop#pop" String="_[_[:alnum:]]*\b" /> |
| 515 |
</context> |
| 516 |
|
| 517 |
<context name="IdentifierError" attribute="Error" lineEndContext="#stay" fallthroughContext="#pop#pop"> |
| 518 |
<RegExpr attribute="Error" context="#pop#pop" String=".[^\s()]*" /> |
| 519 |
</context> |
| 520 |
|
| 521 |
|
| 522 |
<context name="Char8" attribute="Char" lineEndContext="#pop" fallthroughContext="CharClose"> |
| 523 |
<HlCStringChar attribute="String Char" context="CharClose"/> |
| 524 |
<IncludeRules context="FindSingleChar"/> |
| 525 |
</context> |
| 526 |
|
| 527 |
<context name="Char16" attribute="Char" lineEndContext="#pop" fallthroughContext="CharClose"> |
| 528 |
<RegExpr attribute="String Char" context="CharClose" String="\\(?:[tnvbrfa'"\\?]|[0-7]{1,3}|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4})|" /> |
| 529 |
<IncludeRules context="FindSingleChar"/> |
| 530 |
</context> |
| 531 |
|
| 532 |
<context name="Char32" attribute="Char" lineEndContext="#pop" fallthroughContext="CharClose"> |
| 533 |
<RegExpr attribute="String Char" context="CharClose" String="\\(?:[tnvbrfa'"\\?]|[0-7]{1,3}|x[0-9A-Fa-f]{1,8}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})|" /> |
| 534 |
<IncludeRules context="FindSingleChar"/> |
| 535 |
</context> |
| 536 |
|
| 537 |
<context name="FindSingleChar" attribute="Char" lineEndContext="#pop"> |
| 538 |
<DetectChar attribute="Error" context="#pop" char="'" /> |
| 539 |
<RegExpr attribute="Char" context="CharClose" String="." /> |
| 540 |
</context> |
| 541 |
|
| 542 |
<context name="CharClose" attribute="Error" lineEndContext="#pop#pop"> |
| 543 |
<DetectChar attribute="Char" context="#pop#pop" char="'" /> |
| 544 |
</context> |
| 545 |
|
| 546 |
|
| 547 |
<context name="String8" attribute="String" lineEndContext="#pop"> |
| 548 |
<IncludeRules context="string normal char" /> |
| 549 |
<Detect2Chars context="String8EscapeX" char="\" char1="x" lookAhead="1"/> |
| 550 |
<IncludeRules context="string special char" /> |
| 551 |
</context> |
| 552 |
<context name="String8EscapeX" attribute="String" lineEndContext="#pop"> |
| 553 |
<HlCStringChar attribute="String Char" context="#pop!StringNoHex"/> |
| 554 |
<Detect2Chars context="#pop" attribute="Error" char="\" char1="x"/> |
| 555 |
</context> |
| 556 |
|
| 557 |
<context name="String16" attribute="String" lineEndContext="#pop"> |
| 558 |
<IncludeRules context="string normal char" /> |
| 559 |
<Detect2Chars context="String16EscapeX" char="\" char1="x" lookAhead="1"/> |
| 560 |
<IncludeRules context="string special char" /> |
| 561 |
</context> |
| 562 |
<context name="String16EscapeX" attribute="String" lineEndContext="#pop"> |
| 563 |
<RegExpr attribute="String Char" context="#pop!StringNoHex" String="\\x[0-9A-Fa-f]{1,4}" /> |
| 564 |
<Detect2Chars context="#pop" attribute="Error" char="\" char1="x"/> |
| 565 |
</context> |
| 566 |
|
| 567 |
<context name="String32" attribute="String" lineEndContext="#pop"> |
| 568 |
<IncludeRules context="string normal char" /> |
| 569 |
<Detect2Chars context="String32EscapeX" char="\" char1="x" lookAhead="1"/> |
| 570 |
<IncludeRules context="string special char" /> |
| 571 |
</context> |
| 572 |
<context name="String32EscapeX" attribute="String" lineEndContext="#pop"> |
| 573 |
<RegExpr attribute="String Char" context="#pop!StringNoHex" String="\\x[0-9A-Fa-f]{1,8}" /> |
| 574 |
<Detect2Chars context="#pop" attribute="Error" char="\" char1="x"/> |
| 575 |
</context> |
| 576 |
|
| 577 |
<context name="StringNoHex" attribute="Error" lineEndContext="#pop" fallthroughContext="#pop"> |
| 578 |
<RegExpr attribute="Error" context="#pop" String="[0-9A-Fa-f]{1,}" /> |
| 579 |
</context> |
| 580 |
|
| 581 |
<context name="string special char" attribute="String" lineEndContext="#pop"> |
| 582 |
<HlCStringChar attribute="String Char"/> |
| 583 |
<RegExpr attribute="String Char" String="\\(?:u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})|&printf_like;|&format_like;"/> |
| 584 |
<AnyChar attribute="String" String="%{}"/> |
| 585 |
<RegExpr attribute="Error" String="\\(?:u[^"]{0,3}|U[^"]{0,7}|.)"/> |
| 586 |
<LineContinue attribute="Separator Symbol"/> |
| 587 |
</context> |
| 588 |
|
| 589 |
<context name="string normal char" attribute="String" lineEndContext="#pop"> |
| 590 |
<DetectChar attribute="String" context="UDLStringSuffix" char=""" /> |
| 591 |
<!-- fast way, can be replaced by a `UntilChars` rule if it exists --> |
| 592 |
<!-- % -> printf format ; {} -> std::format --> |
| 593 |
<RegExpr attribute="String" context="#stay" String="[^%\\"{}]+" /> |
| 594 |
</context> |
| 595 |
|
| 596 |
<context name="UDLStringSuffix" attribute="String" fallthroughContext="#pop#pop" lineEndContext="#pop#pop"> |
| 597 |
<WordDetect attribute="Standard Classes" context="#pop#pop" String="sv" /> |
| 598 |
<WordDetect attribute="Standard Classes" context="#pop#pop" String="s" /> |
| 599 |
<RegExpr attribute="UDL String Suffix" context="#pop#pop" String="_[_0-9A-Za-z]*\b" /> |
| 600 |
</context> |
| 601 |
|
| 602 |
|
| 603 |
<context name="Attribute" attribute="Attribute" lineEndContext="#stay"> |
| 604 |
<DetectSpaces/> |
| 605 |
<keyword attribute="Standard Attribute" context="#stay" String="attributes" /> |
| 606 |
<Detect2Chars attribute="Symbol" context="#pop" char="]" char1="]" /> |
| 607 |
<StringDetect attribute="Symbol" context="#pop" String=":>:>" /> <!-- Digraph: ]] --> |
| 608 |
<DetectChar attribute="Separator Symbol" context="#stay" char="," /> |
| 609 |
<AnyChar attribute="Symbol" context="#stay" String="&punctuators;" /> |
| 610 |
<!-- Attributes may contain some text: [[deprecated("Reason text")]] --> |
| 611 |
<DetectChar attribute="String" context="String8" char=""" /> |
| 612 |
<AnyChar attribute="Decimal" context="Integer" String="0123456789" lookAhead="true" /> |
| 613 |
<!-- This keyword may appear in Attribute context. For example in code: |
| 614 |
[[using CC: opt(1), debug]] |
| 615 |
and it should be displayed as keyword, not like part of attribute... |
| 616 |
--> |
| 617 |
<WordDetect attribute="Keyword" context="AttributeNamespace" String="using" /> |
| 618 |
<IncludeRules context="DetectGccAttributes##GCCExtensions" /> |
| 619 |
<RegExpr attribute="CONSTS/MACROS" context="#stay" String="[A-Z][A-Z0-9_]{2,}\b" /> |
| 620 |
<DetectIdentifier /> |
| 621 |
</context> |
| 622 |
|
| 623 |
<context name="Attribute In PP" attribute="Attribute" lineEndContext="#pop"> |
| 624 |
<IncludeRules context="InPreprocessor" /> |
| 625 |
<IncludeRules context="Attribute" /> |
| 626 |
</context> |
| 627 |
|
| 628 |
<context name="AttributeNamespace" attribute="Attribute" lineEndContext="#stay" fallthroughContext="#pop"> |
| 629 |
<DetectSpaces /> |
| 630 |
<IncludeRules context="DetectNamespaceGccAttributes##GCCExtensions" /> |
| 631 |
<DetectIdentifier /> |
| 632 |
</context> |
| 633 |
|
| 634 |
<context name="RawString" attribute="String" lineEndContext="#stay" fallthroughContext="#pop!LineError"> |
| 635 |
<RegExpr attribute="Raw String Delimiter" context="#pop!InRawString" String="([^\(]{0,16})\(" beginRegion="Raw String" /> |
| 636 |
</context> |
| 637 |
|
| 638 |
<context name="InRawString" attribute="Raw String" lineEndContext="#stay" dynamic="true"> |
| 639 |
<!-- fast way, can be replaced by a `UntilChars` rule if it exists --> |
| 640 |
<RegExpr attribute="Raw String" context="#stay" String="[^%){}]+" /> |
| 641 |
<RegExpr attribute="String Char" context="#stay" String="&printf_like;|&format_like;" /> |
| 642 |
<StringDetect attribute="Raw String Delimiter" context="#pop" String=")%1"" dynamic="true" endRegion="Raw String" /> |
| 643 |
</context> |
| 644 |
|
| 645 |
<context name="Region Marker" attribute="Region Marker" lineEndContext="#pop" /> |
| 646 |
|
| 647 |
<context name="DetectNSEnd" attribute="Normal Text" lineEndContext="#stay"> |
| 648 |
<AnyChar attribute="Symbol" context="#pop" String="&ns_punctuators; 	" /> |
| 649 |
<AnyChar attribute="Separator Symbol" context="#pop" String="&separators;" /> |
| 650 |
<!-- This keyword may appear in InternalsNS context. For example in code: |
| 651 |
details::some_class::template some_templated_static(); |
| 652 |
and it should be displayed as keyword, not like part of details namespace... |
| 653 |
--> |
| 654 |
<WordDetect attribute="Keyword" context="#stay" String="template" /> |
| 655 |
<DetectIdentifier context="#stay"/> |
| 656 |
</context> |
| 657 |
|
| 658 |
<context name="Standard Classes" attribute="Standard Classes" lineEndContext="#stay"> |
| 659 |
<IncludeRules context="DetectNSEnd" /> |
| 660 |
</context> |
| 661 |
|
| 662 |
<context name="Boost Stuff" attribute="Boost Stuff" lineEndContext="#stay"> |
| 663 |
<IncludeRules context="DetectNSEnd" /> |
| 664 |
</context> |
| 665 |
|
| 666 |
<context name="InternalsNS" attribute="Internals" lineEndContext="#stay"> |
| 667 |
<IncludeRules context="DetectNSEnd" /> |
| 668 |
</context> |
| 669 |
|
| 670 |
<context name="Standard Classes In PP" attribute="Standard Classes" lineEndContext="#pop"> |
| 671 |
<IncludeRules context="InPreprocessor" /> |
| 672 |
<IncludeRules context="DetectNSEnd" /> |
| 673 |
</context> |
| 674 |
|
| 675 |
<context name="Boost Stuff In PP" attribute="Boost Stuff" lineEndContext="#pop"> |
| 676 |
<IncludeRules context="InPreprocessor" /> |
| 677 |
<IncludeRules context="DetectNSEnd" /> |
| 678 |
</context> |
| 679 |
|
| 680 |
<context name="InternalsNS In PP" attribute="Internals" lineEndContext="#pop"> |
| 681 |
<IncludeRules context="InPreprocessor" /> |
| 682 |
<IncludeRules context="DetectNSEnd" /> |
| 683 |
</context> |
| 684 |
|
| 685 |
<context name="Comment 1" attribute="Comment" lineEndContext="#pop"> |
| 686 |
<LineContinue attribute="Error" context="#stay" /> |
| 687 |
<DetectSpaces /> |
| 688 |
<IncludeRules context="##Comments" /> |
| 689 |
<DetectIdentifier /> |
| 690 |
</context> |
| 691 |
|
| 692 |
<context name="Comment 2" attribute="Comment" lineEndContext="#stay"> |
| 693 |
<DetectSpaces /> |
| 694 |
<LineContinue attribute="Comment" context="#stay" /> |
| 695 |
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment" /> |
| 696 |
<IncludeRules context="##Comments" /> |
| 697 |
<DetectIdentifier /> |
| 698 |
</context> |
| 699 |
|
| 700 |
<context name="AfterHash" attribute="Error" lineEndContext="#pop" fallthroughContext="#pop!LineError"> |
| 701 |
<RegExpr attribute="Preprocessor" context="#pop!PreprocessorCmd" String="&pphash;(?=.)|" firstNonSpace="true" /> |
| 702 |
</context> |
| 703 |
|
| 704 |
<context name="LineError" attribute="Error" lineEndContext="#pop"> |
| 705 |
<LineContinue attribute="Error" context="#stay" /> |
| 706 |
<RegExpr attribute="Error" context="#stay" String="[^\\]+" /> |
| 707 |
</context> |
| 708 |
|
| 709 |
|
| 710 |
<context name="PreprocessorCmd" attribute="Error" lineEndContext="#pop" fallthroughContext="#pop!LineError"> |
| 711 |
<WordDetect attribute="Preprocessor" context="#pop!Include" String="include" /> |
| 712 |
<WordDetect attribute="Preprocessor" context="#pop!PreprocessorIfDef" String="ifdef" beginRegion="PP" lookAhead="true" /> |
| 713 |
<WordDetect attribute="Preprocessor" context="#pop!PreprocessorIfDef" String="ifndef" beginRegion="PP" lookAhead="true" /> |
| 714 |
<WordDetect attribute="Preprocessor" context="#pop!PreprocessorIf" String="if" beginRegion="PP" lookAhead="true" /> |
| 715 |
<WordDetect attribute="Preprocessor" context="#pop!PreprocessorIf" String="elif" endRegion="PP" beginRegion="PP" lookAhead="true" /> |
| 716 |
<WordDetect attribute="Preprocessor" context="PreprocessorEndOfLineSpace" String="else" endRegion="PP" beginRegion="PP" /> |
| 717 |
<WordDetect attribute="Preprocessor" context="PreprocessorEndOfLineSpace" String="endif" endRegion="PP" /> |
| 718 |
<WordDetect attribute="Preprocessor" context="#pop!PreprocessorIfDef" String="elifdef" endRegion="PP" beginRegion="PP" lookAhead="true" /> |
| 719 |
<WordDetect attribute="Preprocessor" context="#pop!PreprocessorIfDef" String="elifndef" endRegion="PP" beginRegion="PP" lookAhead="true" /> |
| 720 |
<keyword attribute="Preprocessor" context="#pop!Define" String="preprocessorDefine" /> |
| 721 |
<keyword attribute="Preprocessor" context="#pop!Preprocessor" String="preprocessorOther" /> |
| 722 |
<!-- GCC extension --> |
| 723 |
<WordDetect attribute="Preprocessor" context="#pop!Include" String="include_next" /> |
| 724 |
<Int attribute="Preprocessor" context="#pop!Preprocessor"/> |
| 725 |
</context> |
| 726 |
|
| 727 |
<context name="Include" attribute="Preprocessor" lineEndContext="#pop"> |
| 728 |
<DetectSpaces/> |
| 729 |
<RangeDetect attribute="Prep. Lib" context="PreprocessorEndOfLineSpace" char=""" char1=""" /> |
| 730 |
<RangeDetect attribute="Prep. Lib" context="PreprocessorEndOfLineSpace" char="<" char1=">" /> |
| 731 |
<IncludeRules context="Preprocessor" /> |
| 732 |
<DetectIdentifier/> |
| 733 |
</context> |
| 734 |
|
| 735 |
<context name="PreprocessorIfDef" attribute="Preprocessor" lineEndContext="#pop" fallthroughContext="#pop!LineError"> |
| 736 |
<RegExpr attribute="Preprocessor" context="#pop!Preprocessor" String="\w+\s+([_A-Za-z][A-Za-z0-9]*\s*|(?=//|/\*))" /> |
| 737 |
</context> |
| 738 |
|
| 739 |
<context name="PreprocessorIf" attribute="Preprocessor" lineEndContext="#pop" fallthroughContext="#pop!LineError"> |
| 740 |
<RegExpr attribute="Preprocessor" context="#pop!Inscoped" String="\w+&ppcond1;" /> |
| 741 |
<RegExpr attribute="Preprocessor" context="#pop!Outscoped" String="\w+&ppcond0;" /> |
| 742 |
<RegExpr attribute="Preprocessor" context="#pop!Preprocessor" String="\w+\s+(?=[^\s])" /> |
| 743 |
</context> |
| 744 |
|
| 745 |
<context name="PreprocessorEndOfLineSpace" attribute="Preprocessor" lineEndContext="#pop#pop" fallthroughContext="#pop#pop!LineError"> |
| 746 |
<DetectSpaces /> |
| 747 |
<IncludeRules context="match comments" /> |
| 748 |
</context> |
| 749 |
|
| 750 |
<context name="Preprocessor" attribute="Preprocessor" lineEndContext="#pop"> |
| 751 |
<LineContinue attribute="Preprocessor" context="#stay" /> |
| 752 |
<keyword attribute="Standard Macros" context="#stay" String="StdMacros" /> |
| 753 |
<IncludeRules context="GNUMacros##GCCExtensions" /> |
| 754 |
<IncludeRules context="match comments" /> |
| 755 |
</context> |
| 756 |
|
| 757 |
<context name="Define" attribute="Preprocessor" lineEndContext="#pop"> |
| 758 |
<DetectSpaces/> |
| 759 |
<!-- |
| 760 |
Old version: non-contextual macro |
| 761 |
<IncludeRules context="InPreprocessor" /> |
| 762 |
<keyword attribute="Standard Macros" context="#stay" String="StdMacros" /> |
| 763 |
<keyword attribute="Standard Macros" context="#stay" String="InMacro" /> |
| 764 |
<IncludeRules context="GNUMacros##GCCExtensions" /> |
| 765 |
<IncludeRules context="match comments" /> |
| 766 |
--> |
| 767 |
|
| 768 |
<IncludeRules context="InPreprocessor" /> |
| 769 |
<Detect2Chars attribute="Error" context="#pop!LineError" char="/" char1="/" /> |
| 770 |
<Detect2Chars attribute="Comment" context="MatchComment" char="/" char1="*" lookAhead="true" /> |
| 771 |
<IncludeRules context="GNUMacros##GCCExtensions" /> |
| 772 |
<DetectIdentifier attribute="Preprocessor" context="#pop!In Define"/> |
| 773 |
</context> |
| 774 |
|
| 775 |
<context name="In Define" attribute="Preprocessor" lineEndContext="#pop"> |
| 776 |
<DetectSpaces/> |
| 777 |
<LineContinue attribute="Separator Symbol" context="#stay" /> |
| 778 |
<!-- Match scope regions and punctuators (partial for fast path) --> |
| 779 |
<AnyChar attribute="Symbol" context="#stay" String="#:(){}]+-*%=>!|&~^" /> |
| 780 |
<!-- Detect attributes --> |
| 781 |
<Detect2Chars attribute="Symbol" context="Attribute In PP" char="[" char1="[" /> |
| 782 |
<StringDetect attribute="Symbol" context="Attribute In PP" String="<:<:" /> <!-- Digraph: [[ --> |
| 783 |
<!-- Match numbers --> |
| 784 |
<RegExpr context="Number" String="\.?\d" lookAhead="true" /> |
| 785 |
<!-- Match comments --> |
| 786 |
<IncludeRules context="match comments" /> |
| 787 |
<!-- Match punctuators --> |
| 788 |
<AnyChar attribute="Separator Symbol" context="#stay" String="&separators;" /> |
| 789 |
<AnyChar attribute="Symbol" context="#stay" String="&punctuators;" /> |
| 790 |
<!-- Match keywords --> |
| 791 |
<IncludeRules context="match keywords" /> |
| 792 |
<!-- Match string literals --> |
| 793 |
<AnyChar context="SelectStringPP" String="UuLR"'" lookAhead="1"/> |
| 794 |
<!-- Match GCC extensions --> |
| 795 |
<IncludeRules context="DetectGccExtensionsInPP##GCCExtensions" /> |
| 796 |
<!-- Match most used namespaces and styles --> |
| 797 |
<RegExpr context="DispatchNamespacePP" String="(std::)|(boost::|BOOST_)|details?::|aux::|internals::" lookAhead="1"/> |
| 798 |
<keyword attribute="Standard Macros" context="#stay" String="InMacro" /> |
| 799 |
<IncludeRules context="match identifier" /> |
| 800 |
<!-- Match invalid symbols --> |
| 801 |
<AnyChar attribute="Error" context="#stay" String="$@`\" /> |
| 802 |
</context> |
| 803 |
|
| 804 |
<context name="InPreprocessor" attribute="Normal Text" lineEndContext="#pop"> |
| 805 |
<LineContinue attribute="Separator Symbol" context="#stay" /> |
| 806 |
<DetectChar attribute="Error" context="#stay" char="\" /> |
| 807 |
</context> |
| 808 |
|
| 809 |
<context name="Outscoped Common" attribute="Comment" lineEndContext="#stay"> |
| 810 |
<DetectSpaces /> |
| 811 |
<IncludeRules context="##Comments" /> |
| 812 |
<DetectIdentifier /> |
| 813 |
<!-- prevent incorrect highlighting in case of not closed properly comment block --> |
| 814 |
<Detect2Chars attribute="Comment" context="#stay" char="*" char1="/" /> |
| 815 |
<IncludeRules context="match comments" /> |
| 816 |
<RegExpr attribute="Comment" context="Outscoped intern" String="&pphash;if|" beginRegion="PP" firstNonSpace="true" /> |
| 817 |
<LineContinue context="#stay" /> |
| 818 |
</context> |
| 819 |
|
| 820 |
<context name="Outscoped" attribute="Comment" lineEndContext="#stay"> |
| 821 |
<DetectSpaces /> |
| 822 |
<RegExpr attribute="Preprocessor" context="Outscoped AfterHash" String="&ispphash;|" firstNonSpace="true" lookAhead="true" /> |
| 823 |
<IncludeRules context="Outscoped Common" /> |
| 824 |
</context> |
| 825 |
|
| 826 |
<context name="Outscoped AfterHash" attribute="Comment" lineEndContext="#pop"> |
| 827 |
<RegExpr attribute="Preprocessor" context="#pop#pop!PreprocessorEndOfLineSpace" String="&pphash;endif\b" endRegion="PP" /> |
| 828 |
<RegExpr attribute="Preprocessor" context="#pop#pop!Inscoped" String="&pphash;else\b" endRegion="PP" beginRegion="PP" /> |
| 829 |
<RegExpr attribute="Comment" context="#pop!Outscoped intern" String="&pphash;if" beginRegion="PP" /> |
| 830 |
<RegExpr attribute="Preprocessor" context="#pop#pop!Inscoped" String="&pphash;elif&ppcond1;" endRegion="PP" beginRegion="PP" /> |
| 831 |
<RegExpr attribute="Preprocessor" context="#pop" String="&pphash;elif&ppcond0;" endRegion="PP" beginRegion="PP" /> |
| 832 |
<RegExpr attribute="Preprocessor" context="#pop#pop!Preprocessor" String="&pphash;elif\b" endRegion="PP" beginRegion="PP" /> |
| 833 |
<RegExpr attribute="Comment" context="#pop" String="&pphash;" /> |
| 834 |
</context> |
| 835 |
|
| 836 |
<context name="Outscoped 2" attribute="Comment" lineEndContext="#stay"> |
| 837 |
<IncludeRules context="Outscoped Common" /> |
| 838 |
<RegExpr attribute="Preprocessor" context="#pop!PreprocessorEndOfLineSpace" String="&pphash;endif|" endRegion="PP" firstNonSpace="true" /> |
| 839 |
</context> |
| 840 |
|
| 841 |
<context name="Inscoped" attribute="Normal Text" lineEndContext="#stay"> |
| 842 |
<DetectSpaces /> |
| 843 |
<RegExpr attribute="Preprocessor" context="Inscoped AfterHash" String="&ispphash;|" firstNonSpace="true" lookAhead="true" /> |
| 844 |
<IncludeRules context="Main" /> |
| 845 |
</context> |
| 846 |
|
| 847 |
<context name="Inscoped AfterHash" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop!AfterHash"> |
| 848 |
<DetectSpaces /> |
| 849 |
<RegExpr attribute="Preprocessor" context="#pop!Outscoped 2" String="&pphash;el(?:se|if(n?def)?)" endRegion="PP" beginRegion="PP"/> |
| 850 |
<RegExpr attribute="Preprocessor" context="#pop#pop!PreprocessorEndOfLineSpace" String="&pphash;endif\b" endRegion="PP" /> |
| 851 |
</context> |
| 852 |
|
| 853 |
<context name="Outscoped intern" attribute="Comment" lineEndContext="#stay"> |
| 854 |
<DetectSpaces /> |
| 855 |
<IncludeRules context="##Comments" /> |
| 856 |
<DetectIdentifier /> |
| 857 |
<!-- prevent incorrect highlighting in case of not closed properly comment block --> |
| 858 |
<Detect2Chars attribute="Comment" context="#stay" char="*" char1="/" /> |
| 859 |
<IncludeRules context="match comments" /> |
| 860 |
<RegExpr attribute="Comment" context="Outscoped intern" String="&pphash;if|" beginRegion="PP" firstNonSpace="true" /> |
| 861 |
<RegExpr attribute="Comment" context="#stay" String="&pphash;el(se|if(n?def)?)|" beginRegion="PP" endRegion="PP" firstNonSpace="true" /> |
| 862 |
<RegExpr attribute="Comment" context="PreprocessorEndOfLineSpace" String="&pphash;endif|" endRegion="PP" firstNonSpace="true" /> |
| 863 |
</context> |
| 864 |
</contexts> |
| 865 |
|
| 866 |
<itemDatas> |
| 867 |
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false" /> |
| 868 |
<itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false" /> |
| 869 |
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false" /> |
| 870 |
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false" /> |
| 871 |
<itemData name="Type Modifiers" defStyleNum="dsAttribute" spellChecking="false" /> |
| 872 |
<itemData name="Attribute" defStyleNum="dsAttribute" spellChecking="false" bold="false" italic="true" /> |
| 873 |
<itemData name="Standard Attribute" defStyleNum="dsAttribute" spellChecking="false" bold="false" italic="true" /> |
| 874 |
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false" /> |
| 875 |
<itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false" /> |
| 876 |
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false" /> |
| 877 |
<itemData name="Binary" defStyleNum="dsBaseN" spellChecking="false" /> |
| 878 |
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false" /> |
| 879 |
<itemData name="Char" defStyleNum="dsChar" spellChecking="false" /> |
| 880 |
<itemData name="Char Literal Prefix" defStyleNum="dsChar" spellChecking="false" /> |
| 881 |
<itemData name="String" defStyleNum="dsString" spellChecking="true" /> |
| 882 |
<itemData name="String Char" defStyleNum="dsSpecialChar" spellChecking="false" /> |
| 883 |
<itemData name="String Literal Prefix" defStyleNum="dsString" spellChecking="true" /> |
| 884 |
<itemData name="Raw String" defStyleNum="dsVerbatimString" spellChecking="true" /> |
| 885 |
<itemData name="Raw String Delimiter" defStyleNum="dsString" spellChecking="false" /> |
| 886 |
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true" /> |
| 887 |
<itemData name="Symbol" defStyleNum="dsOperator" spellChecking="false" /> |
| 888 |
<itemData name="Separator Symbol" defStyleNum="dsOperator" spellChecking="false" /> |
| 889 |
<itemData name="Data Members (m_*)" defStyleNum="dsVariable" spellChecking="false" /> |
| 890 |
<itemData name="Globals (g_*)" defStyleNum="dsVariable" spellChecking="false" /> |
| 891 |
<itemData name="Statics (s_*)" defStyleNum="dsVariable" spellChecking="false" /> |
| 892 |
<itemData name="Types (*_t/*_type)" defStyleNum="dsDataType" spellChecking="false" /> |
| 893 |
<itemData name="CONSTS/MACROS" defStyleNum="dsNormal" spellChecking="false" /> |
| 894 |
<itemData name="Preprocessor" defStyleNum="dsPreprocessor" spellChecking="false" /> |
| 895 |
<itemData name="Prep. Lib" defStyleNum="dsImport" spellChecking="false" /> |
| 896 |
<itemData name="Standard Macros" defStyleNum="dsOthers" spellChecking="false" /> |
| 897 |
<itemData name="Standard Classes" defStyleNum="dsBuiltIn" spellChecking="false" /> |
| 898 |
<itemData name="Boost Stuff" defStyleNum="dsExtension" spellChecking="false" /> |
| 899 |
<itemData name="Internals" defStyleNum="dsNormal" spellChecking="false" color="#808080" selColor="#808080" /> |
| 900 |
<itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false" /> |
| 901 |
<itemData name="UDL Numeric Suffix" defStyleNum="dsDecVal" spellChecking="false" /> |
| 902 |
<itemData name="UDL String Suffix" defStyleNum="dsString" spellChecking="false" /> |
| 903 |
<itemData name="Standard Suffix" defStyleNum="dsBuiltIn" spellChecking="false" /> |
| 904 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false" /> |
| 905 |
</itemDatas> |
| 906 |
</highlighting> |
| 907 |
<general> |
| 908 |
<comments> |
| 909 |
<comment name="singleLine" start="//" position="afterwhitespace"/> |
| 910 |
<comment name="multiLine" start="/*" end="*/" region="Comment" /> |
| 911 |
</comments> |
| 912 |
<keywords casesensitive="1" additionalDeliminator="#"" /> |
| 913 |
</general> |
| 914 |
</language> |
| 915 |
<!-- kate: indent-width 2; tab-width 2; --> |