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