KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

194 lines
6.6KB

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