<?php
/*************************************************************************************
 * ocaml.php
 * ----------
 * Author: bluestorm (bluestorm.dylc@gmail.com), Flaie (fireflaie@gmail.com)
 * Copyright: (c) 2005 bluestorm, Flaie, Nigel McNie (http://qbnz.com/highlighter)
 * Release Version: 2.0.0
 * CVS Revision Version: $Revision: 1.10 $
 * Date Started: 2005/08/27
 * Last Modified: $Date: 2006/08/08
 *
 * OCaml (Objective Caml) language file for GeSHi.
 *
 * CHANGES
 * -------
 * 2005/08/27 (1.0.0)
 *   -  First Release
 * 2006/08/08 (2.0.0)
 *   -  Rewrite by bluestorm
 *
 * TODO (updated 2006/08/08)
 * -------------------------
 *
 *************************************************************************************
 *
 *   This file is part of GeSHi.
 *
 *   GeSHi is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   GeSHi is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with GeSHi; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 ************************************************************************************/

if (!defined('OCAML_DOC_URL'))
	//define('OCAML_DOC_URL', 'http://caml.inria.fr/pub/docs/manual-ocaml/');
	define('OCAML_DOC_URL', 'file:////home/bluestorm/Documents/caml/htmlman/');

$language_data = array (
	'LANG_NAME' => 'OCaml',
	'COMMENT_SINGLE' => array(),
	'COMMENT_MULTI' => array('(*' => '*)'),
	'CASE_KEYWORDS' => 0,
	'QUOTEMARKS' => array('"'),
	'ESCAPE_CHAR' => '\\',
	'KEYWORDS' => array(
		/* keywords */
		1 => array(
			// OCaml keywords (but symbols)
			/*'and'*/ 'as', 'assert', 'asr', 'begin'/*, 'class'*/
			, 'constraint', 'do', 'done', 'downto', 'else', 'end'
			, 'exception', 'external', 'failwith', 'false', 'for', 'fun', 'function'
			, 'functor', 'if'/*, 'in'*/, 'include', 'inherit', 'initializer'
			, 'land', 'lazy'/*, 'let'*/, 'lor', 'lsl', 'lsr'
			, 'lxor', 'match', 'method', 'mod'/*, 'module'*/, 'mutable'
			, 'new', 'object', 'of'/*, 'open'*/, 'or', 'private'
			, 'rec', 'sig', 'struct', 'then', 'to', 'true'
			, 'try'/*, 'type'*/, 'val', 'virtual', 'when', 'while'
			, 'with'
			// Caml4p keywords (but symbols)
			, 'parser'
		),
		/* built-in constructors */
		2 => array(
			/* OCaml built-in constructors */
			'false', 'true'//, '()', '[]'//, 'None', 'Some'
		),
		/* built-in exceptions */
		3 => array(
			'Match_failure', 'Assert_failure', 'Invalid_argument', 'Failure'
			, 'Not_found', 'Out_of_memory', 'Stack_overflow', 'Sys_error'
			, 'End_of_file', 'Division_by_zero', 'Sys_blocked_io', 'Undefined_recursive_module'
		),
		/* main librairies (link) */
		4 => array(
			'Arg', 'Arith_status', 'Array', 'ArrayLabels', 'Big_int', 'Bigarray', 'Buffer', 'Callback',
			'CamlinternalOO', 'Char', 'Complex', 'Condition', 'Dbm', 'Digest', 'Dynlink', 'Event',
			'Filename', 'Format', 'Gc', 'Genlex', 'Graphics', 'GraphicsX11', 'Hashtbl', 'Int32', 'Int64',
			'Lazy', 'Lexing', 'List', 'ListLabels', 'Map', 'Marshal', 'MoreLabels', 'Mutex', 'Nativeint',
			'Num', 'Obj', 'Oo', 'Parsing', 'Pervasives', 'Printexc', 'Printf', 'Queue', 'Random', 'Scanf',
			'Set', 'Sort', 'Stack', 'StdLabels', 'Str', 'Stream', 'String', 'StringLabels', 'Sys', 'Thread',
			'ThreadUnix', 'Tk'
		),
		/* Pervasives values (link) */
		5 => array(
			'invalid_arg', 'failwith', 'min', 'max', 'abs', 'max_int', 'min_int', 'lnot', 'infinity'
			, 'neg_infinity', 'nan', 'max_float', 'min_float', 'epsilon_float', 'char_of_int'
			, 'string_of_bool', 'bool_of_string', 'string_of_int', 'string_of_float'
			, 'stdin', 'stdout', 'stderr', 'print_char', 'print_string', 'print_int'
			, 'print_float', 'print_endline', 'print_newline', 'prerr_char', 'prerr_string'
			, 'prerr_int', 'prerr_float', 'prerr_endline', 'prerr_newline', 'read_line', 'read_int'
			, 'read_float', 'open_out', 'open_out_bin', 'open_out_gen', 'flush', 'flush_all'
			, 'output_char', 'output_string', 'output', 'output_byte', 'output_binary_int'
			, 'output_value', 'seek_out', 'pos_out', 'out_channel_length', 'close_out'
			, 'close_out_noerr', 'set_binary_mode_out', 'open_in', 'open_in_bin', 'open_in_gen'
			, 'input_char', 'input_line', 'input', 'really_input', 'input_byte', 'input_binary_int'
			, 'input_value', 'seek_in', 'pos_in', 'in_channel_length', 'close_in', 'close_in_noerr'
			, 'set_binary_mode_in', 'seek_out', 'pos_out', 'out_channel_length', 'seek_in', 'pos_in'
			, 'in_channel_length', 'string_of_format', 'exit', 'at_exit', 'valid_float_lexem'
			, 'unsafe_really_input', 'do_at_exit'
		),
		/* Pervasives exceptions (link) */
		6 => array(
			'Exit'
		),
		/* super keywords ! */
		7 => array(
			'let', 'and', 'in'
			, 'type', 'class', 'module'
			, 'open'
		),
	),
	'SYMBOLS' => array(
		// prefix symbols
		'!', '?', '~'
		// infix symbols
		, '=', '<', '>', '@', '^', '|', '&', '+', '-', '*', '/', '$', '%'
		//operator-char
		, '.', ':'
		// keywords
		, '#', '!=', '&&', '\'', '(', ')'
		, '-.', '->', '..', ':=', ':>', ';', ';;'
		, '<-', '>]', '>}', '??', '[', '[<', '[>', '[|'
		, ']', '_', '`', '{', '{<', '|]', '}'
	),
	'CASE_SENSITIVE' => array(
		GESHI_COMMENTS => true,
		1 => true,
		2 => true,
		3 => true,
		4 => true 
	),
	'STYLES' => array(
		'KEYWORDS' => array(
			1 => 'color: #8800EE;' /* nice blue */
			, 2 => 'font-weight: bold;'
			, 3 => 'color: red;'
			, 4 => 'color: blue;'
			, 5 => 'color: black;'
			, 6 => 'color: red;'
			, 7 => 'color: FF4000;'
		),
		'COMMENTS' => array(
			'MULTI' => 'color: #5d478b; font-style: italic;' /* light purple */
		),
		'ESCAPE_CHAR' => array(
			0 => 'font-weight: bold;'
		),
		'BRACKETS' => array(
			0 => 'color: #6c6;'
		),
		'STRINGS' => array(
			0 => 'color: #3cb371;' /* nice green */
		),
		'NUMBERS' => array(
			0 => 'color: #c6c;' /* pink */
		),
		'METHODS' => array(
			1 => 'color: #060;' /* dark green */
		),
		'REGEXPS' => array(
			1 => 'color: blue;'	
		),
		'SYMBOLS' => array( 
			0 => 'color: red;'
		),
		'SCRIPT' => array()
	),
	'URLS' => array(
		4 => OCAML_DOC_URL . 'libref/{FNAME}.html' // link to the wanted library
		, 5 => OCAML_DOC_URL . 'libref/Pervasives.html#VAL{FNAME}' // Pervasives values
		, 6 => OCAML_DOC_URL . 'libref/Pervasives.html#EXCEPTION{FNAME}' // Pervasives exception
	),
	'OOLANG' => false,//true,
	'OBJECT_SPLITTERS' => array(
		//1 => '#'
	),
	'REGEXPS' => array(
		1 => '[A-Z][a-zA-Z_0-9]+'
	),
	'STRICT_MODE_APPLIES' => GESHI_NEVER,
	'SCRIPT_DELIMITERS' => array(),
	'HIGHLIGHT_STRICT_BLOCK' => array()
);

?>
