openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

tcl.php (5489B)


      1 <?php
      2 /*************************************************************************************
      3  * tcl.php
      4  * ---------------------------------
      5  * Author: Reid van Melle (rvanmelle@gmail.com)
      6  * Copyright: (c) 2004 Reid van Melle (sorry@nowhere)
      7  * Release Version: 1.0.7.20
      8  * Date Started: 2006/05/05
      9  *
     10  * TCL/iTCL language file for GeSHi.
     11  *
     12  * This was thrown together in about an hour so I don't expect
     13  * really great things.  However, it is a good start.  I never
     14  * got a change to try out the iTCL or object-based support but
     15  * this is not widely used anyway.
     16  *
     17  * CHANGES
     18  * -------
     19  * 2006/05/05 (1.0.0)
     20  *  -  First Release
     21  *
     22  * TODO (updated 2006/05/05)
     23  * -------------------------
     24  * - Get TCL built-in special variables hilighted with a new color..
     25  *   currently, these are listed in //special variables in the keywords
     26  *   section, but they get covered by the general REGEXP for symbols
     27  * - General cleanup, testing, and verification
     28  *
     29  *************************************************************************************
     30  *
     31  *     This file is part of GeSHi.
     32  *
     33  *   GeSHi is free software; you can redistribute it and/or modify
     34  *   it under the terms of the GNU General Public License as published by
     35  *   the Free Software Foundation; either version 2 of the License, or
     36  *   (at your option) any later version.
     37  *
     38  *   GeSHi is distributed in the hope that it will be useful,
     39  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     40  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     41  *   GNU General Public License for more details.
     42  *
     43  *   You should have received a copy of the GNU General Public License
     44  *   along with GeSHi; if not, write to the Free Software
     45  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     46  *
     47  ************************************************************************************/
     48 
     49 $language_data = array (
     50 	'LANG_NAME' => 'TCL',
     51 	'COMMENT_SINGLE' => array(1 => '#'),
     52 	'COMMENT_MULTI' => array(),
     53 	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
     54 	'QUOTEMARKS' => array('"', "'"),
     55 	'ESCAPE_CHAR' => '\\',
     56 	'KEYWORDS' => array(
     57 
     58 		/*
     59 		** Set 1: reserved words
     60 		** http://python.org/doc/current/ref/keywords.html
     61 		*/
     62 		1 => array(
     63 			'proc', 'global', 'upvar', 'if', 'then', 'else', 'elseif', 'for', 'foreach',
     64 			'break', 'continue', 'while', 'set', 'eval', 'case', 'in', 'switch',
     65 			'default', 'exit', 'error', 'proc', 'return', 'uplevel', 'loop', 
     66 			'for_array_keys', 'for_recursive_glob', 'for_file', 'unwind_protect',
     67 			'expr', 'catch', 'namespace', 'rename', 'variable',
     68 			// itcl
     69 			'method', 'itcl_class', 'public', 'protected'),
     70 
     71 		/*
     72 		** Set 2: builtins
     73 		** http://asps.activatestate.com/ASPN/docs/ActiveTcl/8.4/tcl/tcl_2_contents.htm
     74 		*/
     75 		2 => array(
     76 			// string handling
     77 			'append', 'binary', 'format', 're_syntax', 'regexp', 'regsub',
     78 			'scan', 'string', 'subst', 
     79 			// list handling
     80 			'concat', 'join', 'lappend', 'lindex', 'list', 'llength', 'lrange',
     81 			'lreplace', 'lsearch', 'lset', 'lsort', 'split',
     82 			// math
     83 			'expr',
     84 			// procedures and output
     85 			'incr', 'close', 'eof', 'fblocked', 'fconfigure', 'fcopy', 'file',
     86 			'fileevent', 'flush', 'gets', 'open', 'puts', 'read', 'seek', 
     87 			'socket', 'tell',
     88 			// packages and source files
     89 			'load', 'loadTk', 'package', 'pgk::create', 'pgk_mkIndex', 'source',
     90 			// interpreter routines
     91 			'bgerror', 'history', 'info', 'interp', 'memory', 'unknown',
     92 			// library routines
     93 			'enconding', 'http', 'msgcat',
     94 			// system related
     95 			'cd', 'clock', 'exec', 'exit', 'glob', 'pid', 'pwd', 'time',
     96 			// platform specified
     97 			'dde', 'registry', 'resource',
     98 			// special variables
     99 			'$argc', '$argv', '$errorCode', '$errorInfo', '$argv0', 
    100 			'$auto_index', '$auto_oldpath', '$auto_path', '$env', 
    101 			'$tcl_interactive', '$tcl_libpath', '$tcl_library', 
    102 			'$tcl_pkgPath', '$tcl_platform', '$tcl_precision', '$tcl_traceExec',
    103 			),
    104 
    105 		/*
    106 		** Set 3: standard library
    107 		*/
    108 		3 => array(
    109 			'comment', 'dde', 'filename', 'http', 'library', 'memory',
    110 			'packagens', 'registry', 'resource', 'tcltest', 'tclvars',
    111 			),
    112 
    113 		/*
    114 		** Set 4: special methods
    115 		*/
    116 		4 => array(
    117 			)
    118 
    119 		),
    120 	'SYMBOLS' => array(
    121 			'(', ')', '[', ']', '{', '}', '$', '*', '&', '%', '!', ';', '<', '>', '?'
    122 		),
    123 	'CASE_SENSITIVE' => array(
    124 		GESHI_COMMENTS => true,
    125 		1 => true,
    126         2 => true,
    127         3 => true,
    128         4 => true
    129 		),
    130 	'STYLES' => array(
    131 		'KEYWORDS' => array(
    132 			1 => 'color: #ff7700;font-weight:bold;',	// Reserved
    133 			2 => 'color: #008000;',						// Built-ins + self
    134 			3 => 'color: #dc143c;',						// Standard lib
    135 			4 => 'color: #0000cd;'						// Special methods
    136 			),
    137 		'COMMENTS' => array(
    138 			1 => 'color: #808080; font-style: italic;',
    139 			'MULTI' => 'color: #808080; font-style: italic;'
    140 			),
    141 		'ESCAPE_CHAR' => array(
    142 			0 => 'color: #000099; font-weight: bold;'
    143 			),
    144 		'BRACKETS' => array(
    145 			0 => 'color: black;'
    146 			),
    147 		'STRINGS' => array(
    148 			0 => 'color: #483d8b;'
    149 			),
    150 		'NUMBERS' => array(
    151 			0 => 'color: #ff4500;'
    152 			),
    153 		'METHODS' => array(
    154 			1 => 'color: black;'
    155 			),
    156 		'SYMBOLS' => array(
    157 			0 => 'color: #66cc66;'
    158 			),
    159 		'REGEXPS' => array(
    160             0 => 'color: #ff3333;'
    161 			),
    162 		'SCRIPT' => array(
    163 			)
    164 		),
    165 	'URLS' => array(
    166 		),
    167 	'OOLANG' => true,
    168 	'OBJECT_SPLITTERS' => array(
    169 		1 => '::'
    170 		),
    171 	'REGEXPS' => array(
    172 		0 => '[\\$]+[a-zA-Z_][a-zA-Z0-9_]*',
    173 		),
    174 	'STRICT_MODE_APPLIES' => GESHI_NEVER,
    175 	'SCRIPT_DELIMITERS' => array(
    176 		),
    177 	'HIGHLIGHT_STRICT_BLOCK' => array(
    178 		)
    179 );
    180 
    181 ?>