my blog lives here now
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

222 lines
9.9 KiB

7 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Kate syntax highlighting for Objective Caml version 4.02 in the standard and revised syntaxes, with Ocamldoc comments. -->
  3. <!DOCTYPE language SYSTEM "language.dtd"
  4. [
  5. <!-- Regular expresion constants: -->
  6. <!ENTITY LOWER "a-z\300-\326\330-\337"> <!-- Lowercase Latin-1 letters. -->
  7. <!ENTITY UPPER "A-Z\340-\366\370-\377"> <!-- Uppercase Latin-1 letters. -->
  8. <!ENTITY LETTER "&LOWER;&UPPER;"> <!-- All Latin-1 letters. -->
  9. <!ENTITY LIDENT "[&LOWER;_][&LETTER;0-9_']*"> <!-- Lowercase OCaml identifiers. -->
  10. <!ENTITY UIDENT "`?[&UPPER;][&LETTER;0-9_']*"> <!-- Uppercase OCaml identifiers. -->
  11. <!ENTITY IDENT "`?[&LETTER;][&LETTER;0-9_']*"> <!-- All OCaml identifiers. -->
  12. <!ENTITY ESC "(\\[ntbr'&quot;\\]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2})"> <!-- OCaml character code escapes. -->
  13. <!ENTITY DEC "[0-9][0-9_]*"> <!-- Decimal digits with underscores. -->
  14. <!ENTITY INFIX "[:!#$%&amp;*+\\/<=>?@^|-~][:!#$%&amp;*+\\/<=>?@^|-~\.]*">
  15. ]>
  16. <language name="Amulet"
  17. extensions="*.ml;*.mli"
  18. mimetype="text/x-amulet"
  19. section="Sources"
  20. version="6"
  21. priority="10"
  22. kateversion="2.4"
  23. author="Abigail Magalhães ([email protected])"
  24. license="LGPL" >
  25. <highlighting>
  26. <list name="Keywords">
  27. <item>as</item>
  28. <item>forall</item>
  29. <item>begin</item>
  30. <item>class</item>
  31. <item>else</item>
  32. <item>end</item>
  33. <item>external</item>
  34. <item>fun</item>
  35. <item>function</item>
  36. <item>if</item>
  37. <item>in</item>
  38. <item>lazy</item>
  39. <item>let</item>
  40. <item>match</item>
  41. <item>module</item>
  42. <item>of</item>
  43. <item>open</item>
  44. <item>then</item>
  45. <item>type</item>
  46. <item>val</item>
  47. <item>with</item>
  48. <item>instance</item>
  49. <item>rec</item>
  50. <item>import</item>
  51. <item>and</item>
  52. </list>
  53. <list name="Boolean Literals">
  54. <item>true</item>
  55. <item>false</item>
  56. </list>
  57. <list name="Pervasive Functions">
  58. </list>
  59. <list name="Pervasive Types">
  60. <item>string</item>
  61. <item>int</item>
  62. <item>float</item>
  63. <item>bool</item>
  64. <item>unit</item>
  65. <item>lazy</item>
  66. <item>list</item>
  67. <item>constraint</item>
  68. <item>ref</item>
  69. <item>known_string</item>
  70. <item>known_int</item>
  71. <item>row_cons</item>
  72. </list>
  73. <list name="Standard Library Modules">
  74. <item>Amc</item>
  75. </list>
  76. <contexts>
  77. <context name="Code" lineEndContext="#stay" attribute="Normal">
  78. <!-- ] and ]} close code samples in Ocamldoc, so -->
  79. <!-- nested [ ] and { } brackets have to be allowed for: -->
  80. <DetectChar char="[" context="Nested Code 1" attribute="Infix Operator" />
  81. <DetectChar char="{" context="Nested Code 2" attribute="Infix Operator" />
  82. <!-- Comments. -->
  83. <!-- A (** begins a special comment with Ocamldoc documentation markup. -->
  84. <Detect2Chars char="(" char1="*" context="Comment" attribute="Comment" beginRegion="comment" />
  85. <!-- Interpreter directives. -->
  86. <!-- (These are lines where the first symbol is a '#' followed by an identifier. -->
  87. <!-- Such lines could also be part of a method call split over two lines but -->
  88. <!-- it's unlikey anyone would code like that.) -->
  89. <!-- String, character and Camlp4 "quotation" constants. -->
  90. <!-- Note: If you must modify the pattern for characters be precise: -->
  91. <!-- single quotes have several meanings in Ocaml. -->
  92. <DetectChar char="&quot;" context="String" attribute="String" />
  93. <RegExpr String="'(&ESC;|[^'])'" context="#stay" attribute="Character" />
  94. <!-- Identifiers and keywords. -->
  95. <keyword String="Keywords" context="#stay" attribute="Keyword" />
  96. <keyword String="Pervasive Functions" context="#stay" attribute="Pervasive Functions" />
  97. <keyword String="Pervasive Types" context="#stay" attribute="Pervasive Types" />
  98. <keyword String="Standard Library Modules" context="#stay" attribute="Standard Library Modules" />
  99. <keyword String="Boolean Literals" context="#stay" attribute="Boolean Literals" />
  100. <RegExpr String="&LIDENT;" context="#stay" attribute="Lowercase Identifier" />
  101. <RegExpr String="&UIDENT;" context="#stay" attribute="Uppercase Identifier" />
  102. <RegExpr String="'&LIDENT;" context="#stay" attribute="Type Variable" />
  103. <RegExpr String="[\-!#\$%&amp;\*\+/&lt;=&gt;\?&#92;@\^\|~\.:]+"
  104. context="#stay" attribute="Infix Operator" />
  105. <RegExpr String="," context="#stay" attribute="Infix Operator" />
  106. <!-- Numeric constants. -->
  107. <!-- Note that they may contain underscores. -->
  108. <RegExpr String="-?0[xX][0-9A-Fa-f_]+" context="#stay" attribute="Hexadecimal" />
  109. <RegExpr String="-?0[oO][0-7_]+" context="#stay" attribute="Octal" />
  110. <RegExpr String="-?0[bB][01_]+" context="#stay" attribute="Binary" />
  111. <RegExpr String="-?&DEC;(\.&DEC;([eE][-+]?&DEC;)?|[eE][-+]?&DEC;)" context="#stay" attribute="Float" />
  112. <RegExpr String="-?&DEC;" context="#stay" attribute="Decimal" />
  113. <IncludeRules context="Unmatched Closing Brackets" />
  114. </context>
  115. <context name="Nested Code 1" lineEndContext="#stay" attribute="Normal">
  116. <DetectChar char="]" context="#pop" attribute="Infix Operator" />
  117. <IncludeRules context="Code" includeAttrib="true" />
  118. </context>
  119. <context name="Nested Code 2" lineEndContext="#stay" attribute="Normal">
  120. <DetectChar char="}" context="#pop" attribute="Infix Operator" />
  121. <IncludeRules context="Code" includeAttrib="true" />
  122. </context>
  123. <context name="String" lineEndContext="#stay" attribute="String">
  124. <DetectChar char="&quot;" context="#pop" attribute="String" />
  125. <RegExpr String="&ESC;" context="#stay" attribute="Escaped Characters" />
  126. <!-- A backslash at the end of a line in a string indicates -->
  127. <!-- that the string will continue on the next line: -->
  128. <RegExpr String="\\$" context="#stay" attribute="Escaped Characters" />
  129. </context>
  130. <context name="Comment" lineEndContext="#stay" attribute="Comment">
  131. <Detect2Chars char="*" char1=")" context="#pop" attribute="Comment" endRegion="comment" />
  132. <!-- Support for nested comments: -->
  133. <Detect2Chars char="(" char1="*" context="Comment" attribute="Comment" beginRegion="comment" />
  134. <!-- Strings in Ocaml comments must be well-formed: -->
  135. <DetectChar char="&quot;" context="String in Comment" attribute="String in Comment" />
  136. </context>
  137. <context name="String in Comment" lineEndContext="#stay" attribute="String in Comment">
  138. <DetectChar char="&quot;" context="#pop" attribute="String in Comment" />
  139. <IncludeRules context="String" />
  140. </context>
  141. <!-- Unmatched closing brackets- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  142. <context name="Unmatched Closing Brackets" lineEndContext="#stay" attribute="Normal">
  143. <Detect2Chars char="*" char1=")" context="#pop" attribute="Mismatched Brackets" />
  144. <Detect2Chars char="v" char1="}" context="#stay" attribute="Mismatched Brackets" />
  145. <Detect2Chars char="]" char1="}" context="#stay" attribute="Mismatched Brackets" />
  146. <Detect2Chars char="%" char1="}" context="#stay" attribute="Mismatched Brackets" />
  147. <DetectChar char="]" context="#stay" attribute="Mismatched Brackets" />
  148. <DetectChar char="}" context="#stay" attribute="Mismatched Brackets" />
  149. </context>
  150. </contexts>
  151. <itemDatas>
  152. <itemData name="Keyword" defStyleNum="dsKeyword" />
  153. <itemData name="Normal" defStyleNum="dsNormal" />
  154. <itemData name="Infix Operator" defStyleNum="dsOperator" />
  155. <itemData name="Uppercase Identifier" defStyleNum="dsDataType" italic="true" />
  156. <itemData name="Lowercase Identifier" defStyleNum="dsVariable" />
  157. <!-- Lowercase pervasive identifiers: -->
  158. <itemData name="Pervasive Functions" defStyleNum="dsFunction" />
  159. <itemData name="Pervasive Types" defStyleNum="dsDataType" />
  160. <!-- Type variables -->
  161. <itemData name="Type Variable" defStyleNum="dsSpecialString" />
  162. <!-- Uppercase pervasive identifiers: -->
  163. <itemData name="Standard Library Modules" defStyleNum="dsDataType" italic="true" />
  164. <itemData name="Boolean Literals" defStyleNum="dsConstant" />
  165. <itemData name="Decimal" defStyleNum="dsDecVal" />
  166. <itemData name="Hexadecimal" defStyleNum="dsBaseN" />
  167. <itemData name="Octal" defStyleNum="dsBaseN" />
  168. <itemData name="Binary" defStyleNum="dsBaseN" />
  169. <itemData name="Float" defStyleNum="dsFloat" />
  170. <itemData name="Character" defStyleNum="dsChar" />
  171. <itemData name="String" defStyleNum="dsString" />
  172. <itemData name="Escaped Characters" defStyleNum="dsChar" />
  173. <itemData name="Comment" defStyleNum="dsComment" />
  174. <itemData name="String in Comment" defStyleNum="dsComment" bold="true" />
  175. <itemData name="Mismatched Brackets" defStyleNum="dsError" />
  176. </itemDatas>
  177. </highlighting>
  178. <general>
  179. <keywords casesensitive="true" />
  180. <comments>
  181. <comment name="multiLine" start="(*" end="*)" region ="comment" />
  182. </comments>
  183. </general>
  184. </language>
  185. <!-- kate: space-indent on; indent-width 2; replace-tabs on; -->