capnp.xml (7111B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE language SYSTEM "language.dtd"> 3 4 <!-- Syntax highlighting for Kate and QtCreator. To customize colors, see end of file. --> 5 6 <language name="Cap'n Proto" version="0.5" kateversion="2.4" section="Sources" extensions="*.capnp" mimetype="text/x-capnp" license="BSD 2-clause" author="Kenton Varda (kenton@sandstorm.io)"> 7 <highlighting> 8 <list name="keyword"> 9 <item>struct</item> 10 <item>enum</item> 11 <item>interface</item> 12 <item>union</item> 13 <item>import</item> 14 <item>using</item> 15 <item>const</item> 16 <item>annotation</item> 17 <item>extends</item> 18 <item>in</item> 19 <item>of</item> 20 <item>on</item> 21 <item>as</item> 22 <item>with</item> 23 <item>from</item> 24 <item>fixed</item> 25 </list> 26 <list name="type"> 27 <item>union</item> 28 <item>group</item> 29 <item>Void</item> 30 <item>Bool</item> 31 <item>Int8</item> 32 <item>Int16</item> 33 <item>Int32</item> 34 <item>Int64</item> 35 <item>UInt8</item> 36 <item>UInt16</item> 37 <item>UInt32</item> 38 <item>UInt64</item> 39 <item>Float32</item> 40 <item>Float64</item> 41 <item>Text</item> 42 <item>Data</item> 43 <item>AnyPointer</item> 44 <item>AnyStruct</item> 45 <item>Capability</item> 46 <item>List</item> 47 </list> 48 <contexts> 49 <context name="Normal" attribute="Normal" lineEndContext="#stay"> 50 <DetectChar attribute="Comment" context="Comment" char="#"/> 51 <RegExpr attribute="Id" context="#stay" String="@(0x[0-9a-fA-F]+|[0-9]+)\b"/> 52 <DetectChar attribute="Value" context="Value" char="="/> 53 <DetectChar attribute="Type" context="Type" char=":"/> 54 <DetectChar attribute="Annotation" context="Annotation" char="$"/> 55 <keyword String="keyword" context="#stay" attribute="Keyword" /> 56 <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1"/> 57 <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"/> 58 <AnyChar attribute="Symbol" context="#stay" String="!%&*+-./<=>?^|~;[]()"/> 59 </context> 60 <context name="Comment" attribute="Comment" lineEndContext="#pop"></context> 61 <context name="Value" attribute="Value" lineEndContext="#stay"> 62 <DetectChar attribute="Comment" context="Comment" char="#"/> 63 <AnyChar attribute="Value" context="ParenValue" String="(["/> 64 <RegExpr attribute="Value" context="#stay" String=""([^"\\]|\\.)*""/> 65 <RegExpr attribute="Value" context="#stay" String="'([^'\\]|\\.)*'"/> 66 <AnyChar attribute="Symbol" context="#pop" String="{};:=$)," lookAhead="true"/> 67 </context> 68 <context name="ParenValue" attribute="Value" lineEndContext="#stay"> 69 <DetectChar attribute="Comment" context="Comment" char="#"/> 70 <AnyChar attribute="Value" context="ParenValue" String="(["/> 71 <AnyChar attribute="Value" context="#pop" String=")]"/> 72 <AnyChar attribute="Symbol" context="#pop" String="{};" lookAhead="true"/> 73 <RegExpr attribute="Value" context="#stay" String=""([^"\\]|\\.)*""/> 74 <RegExpr attribute="Value" context="#stay" String="'([^'\\]|\\.)*'"/> 75 </context> 76 <context name="Type" attribute="Type" lineEndContext="#stay"> 77 <DetectChar attribute="Comment" context="Comment" char="#"/> 78 <AnyChar attribute="Type" context="ParenType" String="(["/> 79 <keyword String="type" context="#stay" attribute="KeyType" /> 80 <RegExpr attribute="Type" context="#stay" String=""([^"\\]|\\.)*""/> 81 <RegExpr attribute="Type" context="#stay" String="'([^'\\]|\\.)*'"/> 82 <AnyChar attribute="Symbol" context="#pop" String="{};:=$)," lookAhead="true"/> 83 </context> 84 <context name="ParenType" attribute="Type" lineEndContext="#stay"> 85 <DetectChar attribute="Comment" context="Comment" char="#"/> 86 <AnyChar attribute="Type" context="ParenType" String="(["/> 87 <AnyChar attribute="Type" context="#pop" String=")]"/> 88 <keyword String="type" context="#stay" attribute="KeyType" /> 89 <AnyChar attribute="Symbol" context="#pop" String="{};" lookAhead="true"/> 90 <RegExpr attribute="Type" context="#stay" String=""([^"\\]|\\.)*""/> 91 <RegExpr attribute="Type" context="#stay" String="'([^'\\]|\\.)*'"/> 92 </context> 93 <context name="Annotation" attribute="Annotation" lineEndContext="#stay"> 94 <DetectChar attribute="Comment" context="Comment" char="#"/> 95 <AnyChar attribute="Annotation" context="ParenAnnotation" String="(["/> 96 <RegExpr attribute="Annotation" context="#stay" String=""([^"\\]|\\.)*""/> 97 <RegExpr attribute="Annotation" context="#stay" String="'([^'\\]|\\.)*'"/> 98 <AnyChar attribute="Symbol" context="#pop" String="{};:=$)," lookAhead="true"/> 99 </context> 100 <context name="ParenAnnotation" attribute="Annotation" lineEndContext="#stay"> 101 <DetectChar attribute="Comment" context="Comment" char="#"/> 102 <AnyChar attribute="Annotation" context="ParenAnnotation" String="(["/> 103 <AnyChar attribute="Annotation" context="#pop" String=")]"/> 104 <AnyChar attribute="Symbol" context="#pop" String="{};" lookAhead="true"/> 105 <RegExpr attribute="Annotation" context="#stay" String=""([^"\\]|\\.)*""/> 106 <RegExpr attribute="Annotation" context="#stay" String="'([^'\\]|\\.)*'"/> 107 </context> 108 </contexts> 109 <itemDatas> 110 <!-- Since my highlighting approach is different from most programming languages, the contexts 111 don't fit nicely into the standard set, so I have to define colors explicitly. A couple 112 of these, like "keyword" and "type", could be mapped to dsKeyword and dsDataType, but 113 there's a chance the user has mapped the colors for those things to things that would 114 conflict with the manually-defined colors here, which would probably be even more annoying 115 than having the colors be inconsitent from other languages. So, I use manual colors for 116 everything, except comments, which I figure are less likely to have this problem. --> 117 <itemData name="Normal" defStyleNum="dsNormal"/> 118 <itemData name="Keyword" defStyleNum="dsOthers" color="#000099" bold="1"/> 119 <itemData name="Id" defStyleNum="dsOthers" color="#0099FF"/> 120 <itemData name="Annotation" defStyleNum="dsOthers" color="#999900"/> 121 <itemData name="Type" defStyleNum="dsOthers" color="#009900"/> 122 <itemData name="KeyType" defStyleNum="dsOthers" color="#009900" bold="1"/> 123 <itemData name="Value" defStyleNum="dsOthers" color="#003399"/> 124 <itemData name="Comment" defStyleNum="dsComment"/> 125 <itemData name="Symbol" defStyleNum="dsOthers" bold="1"/> 126 </itemDatas> 127 </highlighting> 128 <general> 129 <comments><comment name="singleLine" start="#"/></comments> 130 <keywords casesensitive="1"/> 131 </general> 132 </language>