A tumblelog CMS built on AJAX, PHP and MySQL.

tcl.php 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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.21
  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. $language_data = array (
  49. 'LANG_NAME' => 'TCL',
  50. 'COMMENT_SINGLE' => array(1 => '#'),
  51. 'COMMENT_MULTI' => array(),
  52. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  53. 'QUOTEMARKS' => array('"', "'"),
  54. 'ESCAPE_CHAR' => '\\',
  55. 'KEYWORDS' => array(
  56. /*
  57. ** Set 1: reserved words
  58. ** http://python.org/doc/current/ref/keywords.html
  59. */
  60. 1 => array(
  61. 'proc', 'global', 'upvar', 'if', 'then', 'else', 'elseif', 'for', 'foreach',
  62. 'break', 'continue', 'while', 'set', 'eval', 'case', 'in', 'switch',
  63. 'default', 'exit', 'error', 'proc', 'return', 'uplevel', 'loop',
  64. 'for_array_keys', 'for_recursive_glob', 'for_file', 'unwind_protect',
  65. 'expr', 'catch', 'namespace', 'rename', 'variable',
  66. // itcl
  67. 'method', 'itcl_class', 'public', 'protected'),
  68. /*
  69. ** Set 2: builtins
  70. ** http://asps.activatestate.com/ASPN/docs/ActiveTcl/8.4/tcl/tcl_2_contents.htm
  71. */
  72. 2 => array(
  73. // string handling
  74. 'append', 'binary', 'format', 're_syntax', 'regexp', 'regsub',
  75. 'scan', 'string', 'subst',
  76. // list handling
  77. 'concat', 'join', 'lappend', 'lindex', 'list', 'llength', 'lrange',
  78. 'lreplace', 'lsearch', 'lset', 'lsort', 'split',
  79. // math
  80. 'expr',
  81. // procedures and output
  82. 'incr', 'close', 'eof', 'fblocked', 'fconfigure', 'fcopy', 'file',
  83. 'fileevent', 'flush', 'gets', 'open', 'puts', 'read', 'seek',
  84. 'socket', 'tell',
  85. // packages and source files
  86. 'load', 'loadTk', 'package', 'pgk::create', 'pgk_mkIndex', 'source',
  87. // interpreter routines
  88. 'bgerror', 'history', 'info', 'interp', 'memory', 'unknown',
  89. // library routines
  90. 'enconding', 'http', 'msgcat',
  91. // system related
  92. 'cd', 'clock', 'exec', 'exit', 'glob', 'pid', 'pwd', 'time',
  93. // platform specified
  94. 'dde', 'registry', 'resource',
  95. // special variables
  96. '$argc', '$argv', '$errorCode', '$errorInfo', '$argv0',
  97. '$auto_index', '$auto_oldpath', '$auto_path', '$env',
  98. '$tcl_interactive', '$tcl_libpath', '$tcl_library',
  99. '$tcl_pkgPath', '$tcl_platform', '$tcl_precision', '$tcl_traceExec',
  100. ),
  101. /*
  102. ** Set 3: standard library
  103. */
  104. 3 => array(
  105. 'comment', 'dde', 'filename', 'http', 'library', 'memory',
  106. 'packagens', 'registry', 'resource', 'tcltest', 'tclvars',
  107. ),
  108. /*
  109. ** Set 4: special methods
  110. */
  111. 4 => array(
  112. )
  113. ),
  114. 'SYMBOLS' => array(
  115. '(', ')', '[', ']', '{', '}', '$', '*', '&', '%', '!', ';', '<', '>', '?'
  116. ),
  117. 'CASE_SENSITIVE' => array(
  118. GESHI_COMMENTS => true,
  119. 1 => true,
  120. 2 => true,
  121. 3 => true,
  122. 4 => true
  123. ),
  124. 'STYLES' => array(
  125. 'KEYWORDS' => array(
  126. 1 => 'color: #ff7700;font-weight:bold;', // Reserved
  127. 2 => 'color: #008000;', // Built-ins + self
  128. 3 => 'color: #dc143c;', // Standard lib
  129. 4 => 'color: #0000cd;' // Special methods
  130. ),
  131. 'COMMENTS' => array(
  132. 1 => 'color: #808080; font-style: italic;',
  133. 'MULTI' => 'color: #808080; font-style: italic;'
  134. ),
  135. 'ESCAPE_CHAR' => array(
  136. 0 => 'color: #000099; font-weight: bold;'
  137. ),
  138. 'BRACKETS' => array(
  139. 0 => 'color: black;'
  140. ),
  141. 'STRINGS' => array(
  142. 0 => 'color: #483d8b;'
  143. ),
  144. 'NUMBERS' => array(
  145. 0 => 'color: #ff4500;'
  146. ),
  147. 'METHODS' => array(
  148. 1 => 'color: black;'
  149. ),
  150. 'SYMBOLS' => array(
  151. 0 => 'color: #66cc66;'
  152. ),
  153. 'REGEXPS' => array(
  154. 0 => 'color: #ff3333;'
  155. ),
  156. 'SCRIPT' => array(
  157. )
  158. ),
  159. 'URLS' => array(
  160. ),
  161. 'OOLANG' => true,
  162. 'OBJECT_SPLITTERS' => array(
  163. 1 => '::'
  164. ),
  165. 'REGEXPS' => array(
  166. 0 => '[\\$]+[a-zA-Z_][a-zA-Z0-9_]*',
  167. ),
  168. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  169. 'SCRIPT_DELIMITERS' => array(
  170. ),
  171. 'HIGHLIGHT_STRICT_BLOCK' => array(
  172. )
  173. );
  174. ?>