Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/rust.xml
Show All 22 Lines | 2 | <!-- | |||
---|---|---|---|---|---|
23 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | 23 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
24 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | 24 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | 25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | ||
26 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 26 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
27 | DEALINGS IN THE SOFTWARE. | 27 | DEALINGS IN THE SOFTWARE. | ||
28 | --> | 28 | --> | ||
29 | <!DOCTYPE language SYSTEM "language.dtd" | 29 | <!DOCTYPE language SYSTEM "language.dtd" | ||
30 | [ | 30 | [ | ||
31 | <!ENTITY rustIdent "([a-zA-Z_]|[^[:ascii:]])(\w|[^[:ascii:]])*"> | 31 | <!ENTITY rustIdent "(?:[a-zA-Z_]|[^[:ascii:]])(?:\w|[^[:ascii:]])*"> | ||
32 | <!ENTITY rustIntSuf "([iu](8|16|32|64|128|size)?)?"> | 32 | <!ENTITY rustIntSuf "(?:[iu](?:8|16|32|64|128|size)?)?"> | ||
33 | <!ENTITY commonEscape "([trn0'"\\]|x[0-9a-fA-F]{2})"> | 33 | <!ENTITY commonEscape "(?:[trn0'"\\]|x[0-9a-fA-F]{2})"> | ||
34 | <!ENTITY unicodeEscape "u\{([0-9a-fA-F]_*){1,6}\}"> | 34 | <!ENTITY unicodeEscape "u\{(?:[0-9a-fA-F]_*){1,6}\}"> | ||
35 | ]> | 35 | ]> | ||
36 | <language name="Rust" version="7" kateversion="5.0" section="Sources" extensions="*.rs" mimetype="text/rust" priority="15" license="MIT" author="The Rust Project Developers"> | 36 | <language name="Rust" version="8" kateversion="5.0" section="Sources" extensions="*.rs" mimetype="text/rust" priority="15" license="MIT" author="The Rust Project Developers"> | ||
37 | <highlighting> | 37 | <highlighting> | ||
38 | <list name="fn"> | 38 | <list name="fn"> | ||
39 | <item>fn</item> | 39 | <item>fn</item> | ||
40 | </list> | 40 | </list> | ||
41 | <list name="type"> | 41 | <list name="type"> | ||
42 | <item>type</item> | 42 | <item>type</item> | ||
43 | </list> | 43 | </list> | ||
44 | <list name="keywords"> | 44 | <list name="keywords"> | ||
▲ Show 20 Lines • Show All 322 Lines • ▼ Show 20 Line(s) | 362 | <context attribute="Normal Text" lineEndContext="#stay" name="Normal"> | |||
367 | <keyword String="keywords" attribute="Keyword" context="#stay"/> | 367 | <keyword String="keywords" attribute="Keyword" context="#stay"/> | ||
368 | <keyword String="types" attribute="Type" context="#stay"/> | 368 | <keyword String="types" attribute="Type" context="#stay"/> | ||
369 | <keyword String="ctypes" attribute="CType" context="#stay"/> | 369 | <keyword String="ctypes" attribute="CType" context="#stay"/> | ||
370 | <keyword String="constants" attribute="Constant" context="#stay"/> | 370 | <keyword String="constants" attribute="Constant" context="#stay"/> | ||
371 | <keyword String="cconstants" attribute="CConstant" context="#stay"/> | 371 | <keyword String="cconstants" attribute="CConstant" context="#stay"/> | ||
372 | <keyword String="traits" attribute="Trait" context="#stay"/> | 372 | <keyword String="traits" attribute="Trait" context="#stay"/> | ||
373 | <IncludeRules context="FindComments"/> | 373 | <IncludeRules context="FindComments"/> | ||
374 | <!-- Hexadecimal, Octal & Binary --> | 374 | <!-- Hexadecimal, Octal & Binary --> | ||
375 | <RegExpr String="\b0(x[0-9a-fA-F_]+|o[0-7_]+|b[01_]+)&rustIntSuf;\b" attribute="Number" context="#stay"/> | 375 | <RegExpr String="\b0(?:x[0-9a-fA-F_]+|o[0-7_]+|b[01_]+)&rustIntSuf;\b" attribute="Number" context="#stay"/> | ||
376 | <!-- Float & Decimal --> | 376 | <!-- Float & Decimal --> | ||
377 | <RegExpr String="\b[0-9][0-9_]*((\.[0-9][0-9_]*)?([eE][\+\-]?[0-9_]+)?(f32|f64)?|&rustIntSuf;)\b" attribute="Number" context="#stay"/> | 377 | <RegExpr String="\b[0-9][0-9_]*(?:(?:\.[0-9][0-9_]*)?(?:[eE][\+\-]?[0-9_]+)?(?:f32|f64)?|&rustIntSuf;)\b" attribute="Number" context="#stay"/> | ||
378 | <!-- Invalid number --> | 378 | <!-- Invalid number --> | ||
379 | <RegExpr String="\b0(b[01_]*[^01_]|o[0-7_]*[^0-7_]|x[0-9a-fA-F_]*[^0-9a-fA-F_])\w*&rustIntSuf;\b" attribute="Error" context="#stay"/> | 379 | <RegExpr String="\b0(?:b[01_]*[^01_]|o[0-7_]*[^0-7_]|x[0-9a-fA-F_]*[^0-9a-fA-F_])\w*&rustIntSuf;\b" attribute="Error" context="#stay"/> | ||
380 | <Detect2Chars char="#" char1="[" attribute="Attribute" context="Attribute" beginRegion="Attribute"/> | 380 | <Detect2Chars char="#" char1="[" attribute="Attribute" context="Attribute" beginRegion="Attribute"/> | ||
381 | <StringDetect String="#![" attribute="Attribute" context="Attribute" beginRegion="Attribute"/> | 381 | <StringDetect String="#![" attribute="Attribute" context="Attribute" beginRegion="Attribute"/> | ||
382 | <RegExpr String="&rustIdent;::" attribute="Scope"/> | 382 | <RegExpr String="&rustIdent;::" attribute="Scope"/> | ||
383 | <RegExpr String="::(?=[^\s\:])" attribute="Scope"/> <!-- Points after keyword or group { } --> | 383 | <RegExpr String="::(?=[^\s\:])" attribute="Scope"/> <!-- Points after keyword or group { } --> | ||
384 | <RegExpr String="&rustIdent;!" attribute="Macro"/> | 384 | <RegExpr String="&rustIdent;!" attribute="Macro"/> | ||
385 | <RegExpr String="'&rustIdent;(?!')" attribute="Lifetime"/> | 385 | <RegExpr String="'&rustIdent;(?!')" attribute="Lifetime"/> | ||
386 | <DetectChar char="{" attribute="Symbol" context="#stay" beginRegion="Brace" /> | 386 | <DetectChar char="{" attribute="Symbol" context="#stay" beginRegion="Brace" /> | ||
387 | <DetectChar char="}" attribute="Symbol" context="#stay" endRegion="Brace" /> | 387 | <DetectChar char="}" attribute="Symbol" context="#stay" endRegion="Brace" /> | ||
388 | <!-- Raw Strings --> | 388 | <!-- Raw Strings --> | ||
389 | <RegExpr String="b?r(#*)"" attribute="String" context="RawString" dynamic="true"/> | 389 | <RegExpr String="b?r(#*)"" attribute="String" context="RawString"/> | ||
390 | <!-- Byte Strings --> | 390 | <!-- Byte Strings --> | ||
391 | <Detect2Chars char="b" char1=""" attribute="String" context="ByteString"/> | 391 | <Detect2Chars char="b" char1=""" attribute="String" context="ByteString"/> | ||
392 | <!-- Strings --> | 392 | <!-- Strings --> | ||
393 | <DetectChar char=""" attribute="String" context="String"/> | 393 | <DetectChar char=""" attribute="String" context="String"/> | ||
394 | <!-- Byte --> | 394 | <!-- Byte --> | ||
395 | <RegExpr String="b'(?=([^'\\]|\\&commonEscape;)')" attribute="Character" context="Character"/> | 395 | <RegExpr String="b'(?=(?:[^'\\]|\\&commonEscape;)')" attribute="Character" context="Character"/> | ||
396 | <!-- Character --> | 396 | <!-- Character --> | ||
397 | <DetectChar char="'" attribute="Character" context="Character"/> | 397 | <DetectChar char="'" attribute="Character" context="Character"/> | ||
398 | <DetectChar char="[" attribute="Normal Text" context="#stay" beginRegion="Bracket" /> | 398 | <DetectChar char="[" attribute="Normal Text" context="#stay" beginRegion="Bracket" /> | ||
399 | <DetectChar char="]" attribute="Normal Text" context="#stay" endRegion="Bracket" /> | 399 | <DetectChar char="]" attribute="Normal Text" context="#stay" endRegion="Bracket" /> | ||
400 | <!-- Raw identifier prefix --> | 400 | <!-- Raw identifier prefix --> | ||
401 | <RegExpr String="r#(?=&rustIdent;)" attribute="Raw Identifier" context="#stay"/> | 401 | <RegExpr String="r#(?=&rustIdent;)" attribute="Raw Identifier" context="#stay"/> | ||
402 | <AnyChar String=";,.@~:$?=><&-+|*!/^%" attribute="Symbol" context="#stay"/> | 402 | <AnyChar String=";,.@~:$?=><&-+|*!/^%" attribute="Symbol" context="#stay"/> | ||
403 | <DetectIdentifier/> | 403 | <DetectIdentifier/> | ||
Show All 20 Lines | |||||
424 | <context attribute="String" lineEndContext="#stay" name="String"> | 424 | <context attribute="String" lineEndContext="#stay" name="String"> | ||
425 | <DetectChar char="\" attribute="CharEscape" context="CharEscapeWithUnicode"/> | 425 | <DetectChar char="\" attribute="CharEscape" context="CharEscapeWithUnicode"/> | ||
426 | <DetectChar attribute="String" context="#pop" char="""/> | 426 | <DetectChar attribute="String" context="#pop" char="""/> | ||
427 | </context> | 427 | </context> | ||
428 | <context attribute="String" lineEndContext="#stay" name="ByteString"> | 428 | <context attribute="String" lineEndContext="#stay" name="ByteString"> | ||
429 | <DetectChar char="\" attribute="CharEscape" context="CharEscape"/> | 429 | <DetectChar char="\" attribute="CharEscape" context="CharEscape"/> | ||
430 | <DetectChar attribute="String" context="#pop" char="""/> | 430 | <DetectChar attribute="String" context="#pop" char="""/> | ||
431 | </context> | 431 | </context> | ||
432 | <context attribute="String" lineEndContext="#stay" name="RawString" dynamic="true"> | 432 | <context attribute="String" lineEndContext="#stay" name="RawString"> | ||
433 | <RegExpr String=""%1" attribute="String" context="#pop" dynamic="true"/> | 433 | <StringDetect String=""%1" attribute="String" context="#pop" dynamic="true"/> | ||
434 | </context> | 434 | </context> | ||
435 | <context attribute="Character" lineEndContext="#pop" name="Character" fallthrough="true" fallthroughContext="#pop"> | 435 | <context attribute="Character" lineEndContext="#pop" name="Character" fallthrough="true" fallthroughContext="#pop"> | ||
436 | <RegExpr String="[^'\\](?=')" attribute="Character" context="#stay"/> | 436 | <RegExpr String="[^'\\](?=')" attribute="Character" context="#stay"/> | ||
437 | <RegExpr String="\\(&unicodeEscape;|&commonEscape;)(?=')" attribute="CharEscape" context="#stay"/> | 437 | <RegExpr String="\\(?:&unicodeEscape;|&commonEscape;)(?=')" attribute="CharEscape" context="#stay"/> | ||
438 | <DetectChar attribute="Character" context="#pop" char="'"/> | 438 | <DetectChar attribute="Character" context="#pop" char="'"/> | ||
439 | <RegExpr String="(\\.|[^'\\])[^']*(?='([\d\s!"#$%&'\(\)\*\+,\-\./:;<\=>\?@\[\\\]\^`\{\|\}~[:cntrl:]]|$))" attribute="Error" context="#stay"/> | 439 | <RegExpr String="(?:\\.|[^'\\])[^']*(?='(?:[\d\s!"#$%&'\(\)\*\+,\-\./:;<\=>\?@\[\\\]\^`\{\|\}~[:cntrl:]]|$))" attribute="Error" context="#stay"/> | ||
440 | </context> | 440 | </context> | ||
441 | <context attribute="CharEscape" lineEndContext="#pop" name="CharEscape"> | 441 | <context attribute="CharEscape" lineEndContext="#pop" name="CharEscape"> | ||
442 | <RegExpr String="&commonEscape;" attribute="CharEscape" context="#pop"/> | 442 | <RegExpr String="&commonEscape;" attribute="CharEscape" context="#pop"/> | ||
443 | <RegExpr String="." attribute="Error" context="#pop"/> | 443 | <RegExpr String="." attribute="Error" context="#pop"/> | ||
444 | </context> | 444 | </context> | ||
445 | <context attribute="CharEscape" lineEndContext="#pop" name="CharEscapeWithUnicode"> | 445 | <context attribute="CharEscape" lineEndContext="#pop" name="CharEscapeWithUnicode"> | ||
446 | <RegExpr String="&unicodeEscape;" attribute="CharEscape" context="#pop"/> | 446 | <RegExpr String="&unicodeEscape;" attribute="CharEscape" context="#pop"/> | ||
447 | <IncludeRules context="CharEscape"/> | 447 | <IncludeRules context="CharEscape"/> | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |