|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
2 |
| -<!DOCTYPE language SYSTEM "language.dtd" |
3 |
| -[ |
4 |
| - <!-- TODO: Kate's regex engine has very limited support for |
5 |
| - predefined char classes, so making rustIdent consistent with actual |
6 |
| - Rust identifiers will be a bit difficult --> |
7 |
| - <!ENTITY rustIdent "[a-zA-Z_][a-zA-Z_0-9]*"> |
8 |
| - <!ENTITY rustIntSuf "([iu](8|16|32|64)?)?"> |
9 |
| -]> |
10 |
| -<language name="Rust" version="0.6" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15"> |
| 2 | +<!DOCTYPE language SYSTEM "language.dtd"> |
| 3 | +<language name="Rust" version="0.4.0" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15"> |
11 | 4 | <highlighting>
|
12 | 5 | <list name="fn">
|
13 | 6 | <item> fn </item>
|
|
25 | 18 | <item> drop </item>
|
26 | 19 | <item> else </item>
|
27 | 20 | <item> enum </item>
|
| 21 | + <item> export </item> |
28 | 22 | <item> extern </item>
|
| 23 | + <item> fail </item> |
29 | 24 | <item> for </item>
|
30 | 25 | <item> if </item>
|
31 | 26 | <item> impl </item>
|
|
34 | 29 | <item> loop </item>
|
35 | 30 | <item> match </item>
|
36 | 31 | <item> mod </item>
|
| 32 | + <item> move </item> |
37 | 33 | <item> mut </item>
|
38 | 34 | <item> priv </item>
|
39 | 35 | <item> pub </item>
|
|
47 | 43 | <item> use </item>
|
48 | 44 | <item> while </item>
|
49 | 45 | </list>
|
50 |
| - <list name="traits"> |
51 |
| - <item> Const </item> |
52 |
| - <item> Copy </item> |
53 |
| - <item> Send </item> |
54 |
| - <item> Owned </item> |
55 |
| - <item> Eq </item> |
56 |
| - <item> Ord </item> |
57 |
| - <item> Num </item> |
58 |
| - <item> Ptr </item> |
59 |
| - <item> Drop </item> |
60 |
| - <item> Add </item> |
61 |
| - <item> Sub </item> |
62 |
| - <item> Mul </item> |
63 |
| - <item> Div </item> |
64 |
| - <item> Modulo </item> |
65 |
| - <item> Neg </item> |
66 |
| - <item> BitAnd </item> |
67 |
| - <item> BitOr </item> |
68 |
| - <item> BitXor </item> |
69 |
| - <item> Shl </item> |
70 |
| - <item> Shr </item> |
71 |
| - <item> Index </item> |
72 |
| - </list> |
73 | 46 | <list name="types">
|
74 | 47 | <item> bool </item>
|
75 | 48 | <item> int </item>
|
|
90 | 63 | <item> Either </item>
|
91 | 64 | <item> Option </item>
|
92 | 65 | <item> Result </item>
|
93 |
| - <item> Self </item> |
94 | 66 | </list>
|
95 | 67 | <list name="ctypes">
|
96 | 68 | <item> c_float </item>
|
|
192 | 164 | <keyword String="type" attribute="Keyword" context="Type"/>
|
193 | 165 | <keyword String="keywords" attribute="Keyword" context="#stay"/>
|
194 | 166 | <keyword String="types" attribute="Type" context="#stay"/>
|
195 |
| - <keyword String="traits" attribute="Trait" context="#stay"/> |
196 | 167 | <keyword String="ctypes" attribute="CType" context="#stay"/>
|
197 | 168 | <keyword String="self" attribute="Self" context="#stay"/>
|
198 | 169 | <keyword String="constants" attribute="Constant" context="#stay"/>
|
199 | 170 | <keyword String="cconstants" attribute="CConstant" context="#stay"/>
|
200 | 171 | <Detect2Chars char="/" char1="/" attribute="Comment" context="Commentar 1"/>
|
201 | 172 | <Detect2Chars char="/" char1="*" attribute="Comment" context="Commentar 2" beginRegion="Comment"/>
|
202 |
| - <RegExpr String="0x[0-9a-fA-F_]+&rustIntSuf;" attribute="Number" context="#stay"/> |
203 |
| - <RegExpr String="0b[0-1_]+&rustIntSuf;" attribute="Number" context="#stay"/> |
| 173 | + <RegExpr String="0x[0-9a-fA-F_]+(u8|u16|u32|u64|i8|i16|i32|i64|u|i)?" attribute="Number" context="#stay"/> |
| 174 | + <RegExpr String="0b[0-1_]+(u8|u16|u32|u64|i8|i16|i32|i64|u|i)?" attribute="Number" context="#stay"/> |
204 | 175 | <RegExpr String="[0-9][0-9_]*\.[0-9_]*([eE][+-]?[0-9_]+)?(f32|f64|f)?" attribute="Number" context="#stay"/>
|
205 |
| - <RegExpr String="[0-9][0-9_]*&rustIntSuf;" attribute="Number" context="#stay"/> |
206 |
| - <Detect2Chars char="#" char1="[" attribute="Attribute" context="Attribute" beginRegion="Attribute"/> |
207 |
| - <RegExpr String="&rustIdent;::" attribute="Scope"/> |
208 |
| - <RegExpr String="&rustIdent;!" attribute="Macro"/> |
209 |
| - <RegExpr String="'&rustIdent;(?!')" attribute="Lifetime"/> |
| 176 | + <RegExpr String="[0-9][0-9_]*(u8|u16|u32|u64|i8|i16|i32|i64|u|i)?" attribute="Number" context="#stay"/> |
| 177 | + <RegExpr String="[a-zA-Z_][a-zA-Z0-9_]*::" attribute="Scope"/> |
210 | 178 | <DetectChar char="{" attribute="Symbol" context="#stay" beginRegion="Brace" />
|
211 | 179 | <DetectChar char="}" attribute="Symbol" context="#stay" endRegion="Brace" />
|
212 | 180 | <DetectChar char=""" attribute="String" context="String"/>
|
213 | 181 | <DetectChar char="'" attribute="Character" context="Character"/>
|
214 |
| - <DetectChar char="[" attribute="Symbol" context="#stay" beginRegion="Bracket" /> |
215 |
| - <DetectChar char="]" attribute="Symbol" context="#stay" endRegion="Bracket" /> |
216 | 182 | <DetectIdentifier/>
|
217 | 183 | </context>
|
218 |
| - <context attribute="Attribute" lineEndContext="#stay" name="Attribute"> |
219 |
| - <DetectChar char="]" attribute="Attribute" context="#pop" endRegion="Attribute"/> |
220 |
| - <IncludeRules context="Normal"/> |
221 |
| - </context> |
222 | 184 | <context attribute="Definition" lineEndContext="#stay" name="Function">
|
223 | 185 | <DetectSpaces/>
|
224 | 186 | <DetectChar char="(" attribute="Normal Text" context="#pop"/>
|
|
231 | 193 | </context>
|
232 | 194 | <context attribute="String" lineEndContext="#stay" name="String">
|
233 | 195 | <LineContinue attribute="String" context="#stay"/>
|
234 |
| - <DetectChar char="\" attribute="CharEscape" context="CharEscape"/> |
| 196 | + <HlCStringChar attribute="String Char" context="#stay"/> |
235 | 197 | <DetectChar attribute="String" context="#pop" char="""/>
|
236 | 198 | </context>
|
237 | 199 | <context attribute="Character" lineEndContext="#pop" name="Character">
|
238 |
| - <DetectChar char="\" attribute="CharEscape" context="CharEscape"/> |
| 200 | + <HlCStringChar attribute="Character" context="#stay"/> |
239 | 201 | <DetectChar attribute="Character" context="#pop" char="'"/>
|
240 | 202 | </context>
|
241 |
| - <context attribute="CharEscape" lineEndContext="#pop" name="CharEscape"> |
242 |
| - <AnyChar String="nrt\'"" attribute="CharEscape" context="#pop"/> |
243 |
| - <RegExpr String="x[0-9a-fA-F]{2}" attribute="CharEscape" context="#pop"/> |
244 |
| - <RegExpr String="u[0-9a-fA-F]{4}" attribute="CharEscape" context="#pop"/> |
245 |
| - <RegExpr String="U[0-9a-fA-F]{8}" attribute="CharEscape" context="#pop"/> |
246 |
| - <RegExpr String="." attribute="Error" context="#pop"/> |
247 |
| - </context> |
248 | 203 | <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
|
249 | 204 | <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
|
250 | 205 | <DetectSpaces/>
|
|
256 | 211 | <itemData name="Keyword" defStyleNum="dsKeyword" color="#770088" bold="1"/>
|
257 | 212 | <itemData name="Self" defStyleNum="dsKeyword" color="#FF0000" bold="1"/>
|
258 | 213 | <itemData name="Type" defStyleNum="dsKeyword" color="#4e9a06" bold="1"/>
|
259 |
| - <itemData name="Trait" defStyleNum="dsKeyword" color="#4e9a06" bold="1"/> |
260 | 214 | <itemData name="CType" defStyleNum="dsNormal" color="#4e9a06"/>
|
261 | 215 | <itemData name="Constant" defStyleNum="dsKeyword" color="#116644"/>
|
262 | 216 | <itemData name="CConstant" defStyleNum="dsNormal" color="#116644"/>
|
|
265 | 219 | <itemData name="Scope" defStyleNum="dsNormal" color="#0055AA"/>
|
266 | 220 | <itemData name="Number" defStyleNum="dsDecVal" color="#116644"/>
|
267 | 221 | <itemData name="String" defStyleNum="dsString" color="#FF0000"/>
|
268 |
| - <itemData name="CharEscape" defStyleNum="dsChar" color="#FF0000" bold="1"/> |
| 222 | + <itemData name="String Char" defStyleNum="dsChar" color="#FF0000"/> |
269 | 223 | <itemData name="Character" defStyleNum="dsChar" color="#FF0000"/>
|
270 |
| - <itemData name="Macro" defStyleNum="dsOthers"/> |
271 |
| - <itemData name="Attribute" defStyleNum="dsOthers"/> |
272 |
| - <itemData name="Lifetime" defStyleNum="dsOthers" bold="1"/> |
273 |
| - <itemData name="Error" defStyleNum="dsError"/> |
274 | 224 | </itemDatas>
|
275 | 225 | </highlighting>
|
276 | 226 | <general>
|
|
0 commit comments