Advertisement
Guest User

kate def

a guest
Jan 18th, 2019
735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.14 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Copyright (c) 2015 The Rust Project Developers
  4.  
  5. Permission is hereby granted, free of charge, to any
  6. person obtaining a copy of this software and associated
  7. documentation files (the "Software"), to deal in the
  8. Software without restriction, including without
  9. limitation the rights to use, copy, modify, merge,
  10. publish, distribute, sublicense, and/or sell copies of
  11. the Software, and to permit persons to whom the Software
  12. is furnished to do so, subject to the following
  13. conditions:
  14.  
  15. The above copyright notice and this permission notice
  16. shall be included in all copies or substantial portions
  17. of the Software.
  18.  
  19. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
  20. ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  21. TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  22. PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
  23. SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  24. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  25. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
  26. IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  27. DEALINGS IN THE SOFTWARE.
  28. -->
  29. <!DOCTYPE language SYSTEM "language.dtd"
  30. [
  31. <!-- FIXME: Kate's regex engine has very limited support for
  32. predefined char classes, so making rustIdent consistent with actual
  33. Rust identifiers will be a bit difficult -->
  34. <!ENTITY rustIdent "[a-zA-Z_][a-zA-Z_0-9]*">
  35. <!ENTITY rustIntSuf "([iu](8|16|32|64)?)?">
  36. ]>
  37. <language name="Rust" version="4" kateversion="5.0" section="Sources" extensions="*.rs" mimetype="text/rust" priority="15" license="MIT" author="The Rust Project Developers">
  38. <highlighting>
  39. <list name="fn">
  40. <item> fn </item>
  41. </list>
  42. <list name="type">
  43. <item> type </item>
  44. </list>
  45. <list name="struct">
  46. <item> struct </item>
  47. </list>
  48. <list name="let">
  49. <item> let </item>
  50. <item> for </item>
  51. </list>
  52. <list name="keywords">
  53. <item> abstract </item>
  54. <item> alignof </item>
  55. <item> as </item>
  56. <item> become </item>
  57. <item> box </item>
  58. <item> break </item>
  59. <item> const </item>
  60. <item> continue </item>
  61. <item> crate </item>
  62. <item> do </item>
  63. <item> else </item>
  64. <item> enum </item>
  65. <item> extern </item>
  66. <item> final </item>
  67. <item> if </item>
  68. <item> impl </item>
  69. <item> in </item>
  70. <item> let </item>
  71. <item> loop </item>
  72. <item> macro </item>
  73. <item> match </item>
  74. <item> mod </item>
  75. <item> move </item>
  76. <item> offsetof </item>
  77. <item> override </item>
  78. <item> priv </item>
  79. <item> proc </item>
  80. <item> pub </item>
  81. <item> pure </item>
  82. <item> ref </item>
  83. <item> return </item>
  84. <item> sizeof </item>
  85. <item> static </item>
  86. <item> struct </item>
  87. <item> super </item>
  88. <item> trait </item>
  89. <item> type </item>
  90. <item> typeof </item>
  91. <item> unsafe </item>
  92. <item> unsized </item>
  93. <item> use </item>
  94. <item> virtual </item>
  95. <item> where </item>
  96. <item> while </item>
  97. <item> yield </item>
  98. </list>
  99. <list name="traits">
  100. <item> AsSlice </item>
  101. <item> CharExt </item>
  102. <item> Clone </item>
  103. <item> Copy </item>
  104. <item> Debug </item>
  105. <item> Decodable </item>
  106. <item> Default </item>
  107. <item> Display </item>
  108. <item> DoubleEndedIterator </item>
  109. <item> Drop </item>
  110. <item> Encodable </item>
  111. <item> Eq </item>
  112. <item> Default </item>
  113. <item> Extend </item>
  114. <item> Fn </item>
  115. <item> FnMut </item>
  116. <item> FnOnce </item>
  117. <item> FromPrimitive </item>
  118. <item> Hash </item>
  119. <item> Iterator </item>
  120. <item> IteratorExt </item>
  121. <item> MutPtrExt </item>
  122. <item> Ord </item>
  123. <item> PartialEq </item>
  124. <item> PartialOrd </item>
  125. <item> PtrExt </item>
  126. <item> Rand </item>
  127. <item> Send </item>
  128. <item> Sized </item>
  129. <item> SliceConcatExt </item>
  130. <item> SliceExt </item>
  131. <item> Str </item>
  132. <item> StrExt </item>
  133. <item> Sync </item>
  134. <item> ToString </item>
  135. </list>
  136. <list name="types">
  137. <item> bool </item>
  138. <item> int </item>
  139. <item> isize </item>
  140. <item> uint </item>
  141. <item> usize </item>
  142. <item> i8 </item>
  143. <item> i16 </item>
  144. <item> i32 </item>
  145. <item> i64 </item>
  146. <item> u8 </item>
  147. <item> u16 </item>
  148. <item> u32 </item>
  149. <item> u64 </item>
  150. <item> f32 </item>
  151. <item> f64 </item>
  152. <item> float </item>
  153. <item> char </item>
  154. <item> str </item>
  155. <item> Option </item>
  156. <item> Result </item>
  157. <item> Self </item>
  158. <item> Box </item>
  159. <item> Vec </item>
  160. <item> String </item>
  161. </list>
  162. <list name="ctypes">
  163. <item> c_float </item>
  164. <item> c_double </item>
  165. <item> c_void </item>
  166. <item> FILE </item>
  167. <item> fpos_t </item>
  168. <item> DIR </item>
  169. <item> dirent </item>
  170. <item> c_char </item>
  171. <item> c_schar </item>
  172. <item> c_uchar </item>
  173. <item> c_short </item>
  174. <item> c_ushort </item>
  175. <item> c_int </item>
  176. <item> c_uint </item>
  177. <item> c_long </item>
  178. <item> c_ulong </item>
  179. <item> size_t </item>
  180. <item> ptrdiff_t </item>
  181. <item> clock_t </item>
  182. <item> time_t </item>
  183. <item> c_longlong </item>
  184. <item> c_ulonglong </item>
  185. <item> intptr_t </item>
  186. <item> uintptr_t </item>
  187. <item> off_t </item>
  188. <item> dev_t </item>
  189. <item> ino_t </item>
  190. <item> pid_t </item>
  191. <item> mode_t </item>
  192. <item> ssize_t </item>
  193. </list>
  194. <list name="self">
  195. <item> self </item>
  196. <item> mut </item>
  197. </list>
  198. <list name="constants">
  199. <item> true </item>
  200. <item> false </item>
  201. <item> Some </item>
  202. <item> None </item>
  203. <item> Ok </item>
  204. <item> Err </item>
  205. <item> Success </item>
  206. <item> Failure </item>
  207. <item> Cons </item>
  208. <item> Nil </item>
  209. </list>
  210. <list name="cconstants">
  211. <item> EXIT_FAILURE </item>
  212. <item> EXIT_SUCCESS </item>
  213. <item> RAND_MAX </item>
  214. <item> EOF </item>
  215. <item> SEEK_SET </item>
  216. <item> SEEK_CUR </item>
  217. <item> SEEK_END </item>
  218. <item> _IOFBF </item>
  219. <item> _IONBF </item>
  220. <item> _IOLBF </item>
  221. <item> BUFSIZ </item>
  222. <item> FOPEN_MAX </item>
  223. <item> FILENAME_MAX </item>
  224. <item> L_tmpnam </item>
  225. <item> TMP_MAX </item>
  226. <item> O_RDONLY </item>
  227. <item> O_WRONLY </item>
  228. <item> O_RDWR </item>
  229. <item> O_APPEND </item>
  230. <item> O_CREAT </item>
  231. <item> O_EXCL </item>
  232. <item> O_TRUNC </item>
  233. <item> S_IFIFO </item>
  234. <item> S_IFCHR </item>
  235. <item> S_IFBLK </item>
  236. <item> S_IFDIR </item>
  237. <item> S_IFREG </item>
  238. <item> S_IFMT </item>
  239. <item> S_IEXEC </item>
  240. <item> S_IWRITE </item>
  241. <item> S_IREAD </item>
  242. <item> S_IRWXU </item>
  243. <item> S_IXUSR </item>
  244. <item> S_IWUSR </item>
  245. <item> S_IRUSR </item>
  246. <item> F_OK </item>
  247. <item> R_OK </item>
  248. <item> W_OK </item>
  249. <item> X_OK </item>
  250. <item> STDIN_FILENO </item>
  251. <item> STDOUT_FILENO </item>
  252. <item> STDERR_FILENO </item>
  253. </list>
  254. <contexts>
  255. <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
  256. <DetectSpaces/>
  257. <keyword String="fn" attribute="Keyword" context="Function"/>
  258. <keyword String="type" attribute="Keyword" context="Type"/>
  259. <keyword String="struct" attribute="Keyword" context="Struct"/>
  260. <keyword String="let" attribute="Keyword" context="Let"/>
  261. <keyword String="for" attribute="Keyword" context="Let"/>
  262. <keyword String="keywords" attribute="Keyword" context="#stay"/>
  263. <keyword String="types" attribute="Type" context="#stay"/>
  264. <keyword String="traits" attribute="Trait" context="#stay"/>
  265. <RegExpr String="(\.)&rustIdent;[^\(]" attribute="Trait" context="Trait" lookAhead="true"/>
  266. <keyword String="ctypes" attribute="CType" context="#stay"/>
  267. <keyword String="self" attribute="Self" context="#stay"/>
  268. <keyword String="constants" attribute="Constant" context="#stay"/>
  269. <keyword String="cconstants" attribute="CConstant" context="#stay"/>
  270. <Detect2Chars char="/" char1="/" attribute="Comment" context="Commentar 1"/>
  271. <Detect2Chars char="/" char1="*" attribute="Comment" context="Commentar 2" beginRegion="Comment"/>
  272. <RegExpr String="0x[0-9a-fA-F_]+&rustIntSuf;" attribute="Number" context="#stay"/>
  273. <RegExpr String="0o[0-7_]+&rustIntSuf;" attribute="Number" context="#stay"/>
  274. <RegExpr String="0b[0-1_]+&rustIntSuf;" attribute="Number" context="#stay"/>
  275. <RegExpr String="[0-9][0-9_]*\.[0-9_]*([eE][+-]?[0-9_]+)?(f32|f64|f)?" attribute="Number" context="#stay"/>
  276. <RegExpr String="[0-9][0-9_]*&rustIntSuf;" attribute="Number" context="#stay"/>
  277. <Detect2Chars char="#" char1="[" attribute="Attribute" context="Attribute" beginRegion="Attribute"/>
  278. <StringDetect String="#![" attribute="Attribute" context="Attribute" beginRegion="Attribute"/>
  279. <RegExpr String="&rustIdent;::" attribute="Scope"/>
  280. <RegExpr String="&rustIdent;!" attribute="Macro"/>
  281. <RegExpr String="&apos;&rustIdent;(?!&apos;)" attribute="Lifetime"/>
  282. <DetectChar char="_" attribute="Match" context="#stay"/>
  283. <DetectChar char="{" attribute="Symbol" context="#stay" beginRegion="Brace" />
  284. <DetectChar char="}" attribute="Symbol" context="#stay" endRegion="Brace" />
  285. <Detect2Chars char="r" char1="&quot;" attribute="String" context="RawString"/>
  286. <StringDetect String="r##&quot;" attribute="String" context="RawHashed2"/>
  287. <StringDetect String="r#&quot;" attribute="String" context="RawHashed1"/>
  288. <DetectChar char="&quot;" attribute="String" context="String"/>
  289. <DetectChar char="&apos;" attribute="Character" context="Character"/>
  290. <DetectChar char="[" attribute="Symbol" context="#stay" beginRegion="Bracket" />
  291. <DetectChar char="]" attribute="Symbol" context="#stay" endRegion="Bracket" />
  292. <DetectIdentifier/>
  293. </context>
  294. <context attribute="Attribute" lineEndContext="#stay" name="Attribute">
  295. <DetectChar char="]" attribute="Attribute" context="#pop" endRegion="Attribute"/>
  296. <IncludeRules context="Normal"/>
  297. </context>
  298. <context attribute="Trait" lineEndContext="#stay" name="Trait">
  299. <DetectSpaces/>
  300. <DetectChar char="." attribute="Normal Text" context="#stay"/>
  301. <DetectChar char="(" attribute="Normal Text" context="#pop"/>
  302. <DetectChar char="&lt;" attribute="Normal Text" context="#pop"/>
  303. </context>
  304. <context attribute="Definition" lineEndContext="#stay" name="Function">
  305. <DetectSpaces/>
  306. <DetectChar char="(" attribute="Normal Text" context="#pop"/>
  307. </context>
  308. <context attribute="Definition" lineEndContext="#stay" name="Type">
  309. <DetectSpaces/>
  310. <DetectChar char="=" attribute="Normal Text" context="#pop"/>
  311. <DetectChar char=";" attribute="Normal Text" context="#pop"/>
  312. </context>
  313. <context attribute="Definition" lineEndContext="#stay" name="Struct">
  314. <DetectSpaces/>
  315. <DetectChar char="{" attribute="Normal Text" context="#pop"/>
  316. </context>
  317. <context attribute="Definition" lineEndContext="#stay" name="Let">
  318. <DetectSpaces/>
  319. <DetectChar char=")" attribute="Normal Text" context="#pop"/>
  320. <DetectChar char="=" attribute="Normal Text" context="#pop"/>
  321. <DetectChar char="@" attribute="Normal Text" context="#pop"/>
  322. <DetectChar char=":" attribute="Normal Text" context="#pop"/>
  323. <DetectChar char="(" attribute="Normal Text" context="#stay"/>
  324. <DetectChar char="," attribute="Normal Text" context="#stay"/>
  325. <DetectChar char="_" attribute="Match" context="#stay"/>
  326. <StringDetect String="mut" attribute="Self" context="#stay"/>
  327. </context>
  328. <!-- Rustc allows strings to extend over multiple lines, and the
  329. only thing a backshash at end-of-line does is remove the whitespace. -->
  330. <context attribute="String" lineEndContext="#stay" name="String">
  331. <DetectChar char="\" attribute="CharEscape" context="CharEscape"/>
  332. <DetectChar attribute="String" context="#pop" char="&quot;"/>
  333. </context>
  334. <context attribute="String" lineEndContext="#stay" name="RawString">
  335. <DetectChar attribute="String" context="#pop" char="&quot;"/>
  336. </context>
  337. <!-- These rules are't complete: they won't match r###"abc"### -->
  338. <context attribute="String" lineEndContext="#stay" name="RawHashed1">
  339. <Detect2Chars attribute="String" context="#pop" char="&quot;" char1="#"/>
  340. </context>
  341. <context attribute="String" lineEndContext="#stay" name="RawHashed2">
  342. <StringDetect attribute="String" context="#pop" String="&quot;##"/>
  343. </context>
  344. <context attribute="Character" lineEndContext="#pop" name="Character">
  345. <DetectChar char="\" attribute="CharEscape" context="CharEscape"/>
  346. <DetectChar attribute="Character" context="#pop" char="&apos;"/>
  347. </context>
  348. <context attribute="CharEscape" lineEndContext="#pop" name="CharEscape">
  349. <AnyChar String="nrt\&apos;&quot;" attribute="CharEscape" context="#pop"/>
  350. <RegExpr String="x[0-9a-fA-F]{2}" attribute="CharEscape" context="#pop"/>
  351. <RegExpr String="u\{[0-9a-fA-F]{1,6}\}" attribute="CharEscape" context="#pop"/>
  352. <RegExpr String="u[0-9a-fA-F]{4}" attribute="CharEscape" context="#pop"/>
  353. <RegExpr String="U[0-9a-fA-F]{8}" attribute="CharEscape" context="#pop"/>
  354. <RegExpr String="." attribute="Error" context="#pop"/>
  355. </context>
  356. <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
  357. <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
  358. <DetectSpaces/>
  359. <Detect2Chars char="/" char1="*" attribute="Comment" context="Commentar 2" beginRegion="Comment"/>
  360. <Detect2Chars char="*" char1="/" attribute="Comment" context="#pop" endRegion="Comment"/>
  361. </context>
  362. </contexts>
  363. <itemDatas>
  364. <itemData name="Normal Text" defStyleNum="dsNormal"/>
  365. <itemData name="Keyword" defStyleNum="dsKeyword" color="#808000" />
  366. <itemData name="Self" defStyleNum="dsKeyword" color="#770000"/>
  367. <itemData name="Match" defStyleNum="dsKeyword" color="#c00000" bold="1"/>
  368. <itemData name="Type" defStyleNum="dsDataType" color="#770088"/>
  369. <itemData name="Trait" defStyleNum="dsBuiltIn" color="#ce5c00"/>
  370. <itemData name="CType" defStyleNum="dsDataType" color="#770088"/>
  371. <itemData name="Constant" defStyleNum="dsConstant" color="#000080" bold="1"/>
  372. <itemData name="CConstant" defStyleNum="dsConstant" color="#000080" bold="1"/>
  373. <itemData name="Definition" defStyleNum="dsKeyword" color="#007474"/>
  374. <itemData name="Comment" defStyleNum="dsComment"/>
  375. <itemData name="Scope" defStyleNum="dsKeyword" color="#770088"/>
  376. <itemData name="Number" defStyleNum="dsDecVal"/>
  377. <itemData name="String" defStyleNum="dsString"/>
  378. <itemData name="CharEscape" defStyleNum="dsSpecialChar"/>
  379. <itemData name="Character" defStyleNum="dsChar"/>
  380. <itemData name="Macro" defStyleNum="dsPreprocessor"/>
  381. <itemData name="Symbol" defStyleNum="dsOperator"/>
  382. <itemData name="Attribute" defStyleNum="dsAttribute"/>
  383. <itemData name="Lifetime" defStyleNum="dsOthers"/>
  384. <itemData name="Error" defStyleNum="dsError"/>
  385. </itemDatas>
  386. </highlighting>
  387. <general>
  388. <comments>
  389. <comment name="singleLine" start="//" />
  390. <comment name="multiLine" start="/*" end="*/" region="Comment"/>
  391. </comments>
  392. <keywords casesensitive="1" />
  393. </general>
  394. </language>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement