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