A tumblelog CMS built on AJAX, PHP and MySQL.

ocaml.php 6.5KB

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