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