KXStudio Website https://kx.studio/
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.

187 lines
8.2KB

  1. <?php
  2. /*************************************************************************************
  3. * ocaml.php
  4. * ----------
  5. * Author: Flaie (fireflaie@gmail.com)
  6. * Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2005/08/27
  9. *
  10. * OCaml (Objective Caml) language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2008/03/29 (1.0.7.22)
  15. * - Fixed warnings resulting from missing style information
  16. * 2005/08/27 (1.0.0)
  17. * - First Release
  18. *
  19. * TODO (updated 2005/08/27)
  20. * -------------------------
  21. *
  22. *************************************************************************************
  23. *
  24. * This file is part of GeSHi.
  25. *
  26. * GeSHi is free software; you can redistribute it and/or modify
  27. * it under the terms of the GNU General Public License as published by
  28. * the Free Software Foundation; either version 2 of the License, or
  29. * (at your option) any later version.
  30. *
  31. * GeSHi is distributed in the hope that it will be useful,
  32. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. * GNU General Public License for more details.
  35. *
  36. * You should have received a copy of the GNU General Public License
  37. * along with GeSHi; if not, write to the Free Software
  38. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  39. *
  40. ************************************************************************************/
  41. $language_data = array (
  42. 'LANG_NAME' => 'OCaml',
  43. 'COMMENT_SINGLE' => array(),
  44. 'COMMENT_MULTI' => array('(*' => '*)'),
  45. 'COMMENT_REGEXP' => array(1 => '/\(\*(?:(?R)|.)+?\*\)/s'),
  46. 'CASE_KEYWORDS' => 0,
  47. 'QUOTEMARKS' => array('"'),
  48. 'ESCAPE_CHAR' => "",
  49. 'KEYWORDS' => array(
  50. /* main OCaml keywords */
  51. 1 => array(
  52. 'and', 'as', 'asr', 'begin', 'class', 'closed', 'constraint', 'do', 'done', 'downto', 'else',
  53. 'end', 'exception', 'external', 'failwith', 'false', 'for', 'fun', 'function', 'functor',
  54. 'if', 'in', 'include', 'inherit', 'incr', 'land', 'let', 'load', 'los', 'lsl', 'lsr', 'lxor',
  55. 'match', 'method', 'mod', 'module', 'mutable', 'new', 'not', 'of', 'open', 'option', 'or', 'parser',
  56. 'private', 'ref', 'rec', 'raise', 'regexp', 'sig', 'struct', 'stdout', 'stdin', 'stderr', 'then',
  57. 'to', 'true', 'try', 'type', 'val', 'virtual', 'when', 'while', 'with'
  58. ),
  59. /* define names of main librarys, so we can link to it */
  60. 2 => array(
  61. 'Arg', 'Arith_status', 'Array', //'Array1', 'Array2', 'Array3',
  62. 'ArrayLabels', 'Big_int', 'Bigarray', 'Buffer', 'Callback',
  63. 'CamlinternalLazy', 'CamlinternalMod', 'CamlinternalOO', 'Char',
  64. 'Complex', 'Condition', 'Dbm', 'Digest', 'Dynlink', 'Event',
  65. 'Filename', 'Format', 'Gc', 'Genlex', 'Graphics', 'GraphicsX11',
  66. 'Hashtbl', 'Int32', 'Int64', 'Lazy', 'Lexing', 'List', 'ListLabels',
  67. 'Map', 'Marshal', 'MoreLabels', 'Mutex', 'Nativeint', 'Num', 'Obj',
  68. 'Oo', 'Parsing', 'Pervasives', 'Printexc', 'Printf', 'Queue',
  69. 'Random', 'Scanf', 'Set', 'Sort', 'Stack', 'StdLabels', 'Str',
  70. 'Stream', 'String', 'StringLabels', 'Sys', 'Thread', 'ThreadUnix',
  71. 'Tk', 'Unix', 'UnixLabels', 'Weak'
  72. ),
  73. /* just link to the Pervasives functions library, cause it's the default opened library when starting OCaml */
  74. 3 => array(
  75. 'abs', 'abs_float', 'acos', 'asin', 'at_exit', 'atan', 'atan2',
  76. 'bool_of_string', 'ceil', 'char_of_int', 'classify_float',
  77. 'close_in', 'close_in_noerr', 'close_out', 'close_out_noerr',
  78. 'compare', 'cos', 'cosh', 'decr', 'epsilon_float', 'exit', 'exp',
  79. 'float', 'float_of_int', 'float_of_string', 'floor', 'flush',
  80. 'flush_all', 'format_of_string', 'frexp', 'fst', 'ignore',
  81. 'in_channel_length', 'infinity', 'input', 'input_binary_int',
  82. 'input_byte', 'input_char', 'input_line', 'input_value',
  83. 'int_of_char', 'int_of_float', 'int_of_string', 'invalid_arg',
  84. 'ldexp', 'log', 'log10', 'max', 'max_float', 'max_int', 'min',
  85. 'min_float', 'min_int', 'mod_float', 'modf', 'nan', 'open_in',
  86. 'open_in_bin', 'open_in_gen', 'open_out', 'open_out_bin',
  87. 'open_out_gen', 'out_channel_length', 'output', 'output_binary_int',
  88. 'output_byte', 'output_char', 'output_string', 'output_value',
  89. 'pos_in', 'pos_out', 'pred', 'prerr_char', 'prerr_endline',
  90. 'prerr_float', 'prerr_int', 'prerr_newline', 'prerr_string',
  91. 'print_char', 'print_endline', 'print_float', 'print_int',
  92. 'print_newline', 'print_string', 'read_float', 'read_int',
  93. 'read_line', 'really_input', 'seek_in', 'seek_out',
  94. 'set_binary_mode_in', 'set_binary_mode_out', 'sin', 'sinh', 'snd',
  95. 'sqrt', 'string_of_bool', 'string_of_float', 'string_of_format',
  96. 'string_of_int', 'succ', 'tan', 'tanh', 'truncate'
  97. ),
  98. /* here Pervasives Types */
  99. 4 => array (
  100. 'array','bool','char','exn','file_descr','format','fpclass',
  101. 'in_channel','int','int32','int64','list','nativeint','open_flag',
  102. 'out_channel','string','Sys_error','unit'
  103. ),
  104. /* finally Pervasives Exceptions */
  105. 5 => array (
  106. 'Exit', 'Invalid_Argument', 'Failure', 'Division_by_zero'
  107. )
  108. ),
  109. /* highlighting symbols is really important in OCaml */
  110. 'SYMBOLS' => array(
  111. '+.', '-.', '*.', '/.', '[<', '>]',
  112. ';', '!', ':', '.', '=', '%', '^', '*', '-', '/', '+',
  113. '>', '<', '(', ')', '[', ']', '&', '|', '#', "'",
  114. ),
  115. 'CASE_SENSITIVE' => array(
  116. GESHI_COMMENTS => false,
  117. 1 => false,
  118. 2 => true, /* functions name are case sensitive */
  119. 3 => true, /* types name too */
  120. 4 => true, /* pervasives types */
  121. 5 => true /* pervasives exceptions */
  122. ),
  123. 'STYLES' => array(
  124. 'KEYWORDS' => array(
  125. 1 => 'color: #06c; font-weight: bold;', /* nice blue */
  126. 2 => 'color: #06c; font-weight: bold;', /* nice blue */
  127. 3 => 'color: #06c; font-weight: bold;', /* nice blue */
  128. 4 => 'color: #06c; font-weight: bold;', /* nice blue */
  129. 5 => 'color: #06c; font-weight: bold;' /* nice blue */
  130. ),
  131. 'COMMENTS' => array(
  132. 'MULTI' => 'color: #5d478b; font-style: italic;', /* light purple */
  133. 1 => 'color: #5d478b; font-style: italic;' /* light purple */
  134. ),
  135. 'ESCAPE_CHAR' => array(
  136. ),
  137. 'BRACKETS' => array(
  138. 0 => 'color: #a52a2a;'
  139. ),
  140. 'STRINGS' => array(
  141. 0 => 'color: #3cb371;' /* nice green */
  142. ),
  143. 'NUMBERS' => array(
  144. 0 => 'color: #c6c;' /* pink */
  145. ),
  146. 'METHODS' => array(
  147. 1 => 'color: #060;' /* dark green */
  148. ),
  149. 'REGEXPS' => array(
  150. 1 => 'font-weight:bold; color:#339933;',
  151. 2 => 'font-weight:bold; color:#993399;'
  152. ),
  153. 'SYMBOLS' => array(
  154. 0 => 'color: #a52a2a;' /* maroon */
  155. ),
  156. 'SCRIPT' => array(
  157. )
  158. ),
  159. 'URLS' => array(
  160. /* some of keywords are Pervasives functions (land, lxor, asr, ...) */
  161. 1 => '',
  162. /* link to the wanted library */
  163. 2 => 'http://caml.inria.fr/pub/docs/manual-ocaml/libref/{FNAME}.html',
  164. /* link to Pervasives functions */
  165. 3 => 'http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#VAL{FNAME}',
  166. /* link to Pervasives type */
  167. 4 => 'http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#TYPE{FNAME}',
  168. /* link to Pervasives exceptions */
  169. 5 => 'http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#EXCEPTION{FNAME}'
  170. ),
  171. 'OOLANG' => false,
  172. 'OBJECT_SPLITTERS' => array(
  173. 1 => '.'
  174. ),
  175. 'REGEXPS' => array(
  176. 1 => '~\w+',
  177. 2 => '`(?=(?-i:[a-z]))\w*',
  178. ),
  179. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  180. 'SCRIPT_DELIMITERS' => array(
  181. ),
  182. 'HIGHLIGHT_STRICT_BLOCK' => array(
  183. )
  184. );
  185. ?>