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.

dos.php 7.7KB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <?php
  2. /*************************************************************************************
  3. * dos.php
  4. * -------
  5. * Author: Alessandro Staltari (staltari@geocities.com)
  6. * Copyright: (c) 2005 Alessandro Staltari (http://www.geocities.com/SiliconValley/Vista/8155/)
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2005/07/05
  9. *
  10. * DOS language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2008/05/23 (1.0.7.22)
  15. * - Added description of extra language features (SF#1970248)
  16. * 2005/07/05 (1.0.0)
  17. * - First Release
  18. *
  19. * TODO (updated 2005/07/05)
  20. * -------------------------
  21. *
  22. * - Highlight pipes and redirection (do we really need this?)
  23. * - Add missing keywords.
  24. * - Find a good hyperlink for keywords.
  25. * - Improve styles.
  26. *
  27. * KNOWN ISSUES (updated 2005/07/07)
  28. * ---------------------------------
  29. *
  30. * - Doesn't even try to handle spaces in variables name or labels (I can't
  31. * find a reliable way to establish if a sting is a name or not, in some
  32. * cases it depends on the contex or enviroment status).
  33. * - Doesn't handle %%[letter] pseudo variable used inside FOR constructs
  34. * (it should be done only into its scope: how to handle variable it?).
  35. * - Doesn't handle %~[something] pseudo arguments.
  36. * - If the same keyword is placed at the end of the line and the
  37. * beginning of the next, the second occourrence is not highlighted
  38. * (this should be a GeSHi bug, not related to the language definition).
  39. * - I can't avoid to have keyword highlighted even when they are not used
  40. * as keywords but, for example, as arguments to the echo command.
  41. *
  42. *************************************************************************************
  43. *
  44. * This file is part of GeSHi.
  45. *
  46. * GeSHi is free software; you can redistribute it and/or modify
  47. * it under the terms of the GNU General Public License as published by
  48. * the Free Software Foundation; either version 2 of the License, or
  49. * (at your option) any later version.
  50. *
  51. * GeSHi is distributed in the hope that it will be useful,
  52. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  53. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  54. * GNU General Public License for more details.
  55. *
  56. * You should have received a copy of the GNU General Public License
  57. * along with GeSHi; if not, write to the Free Software
  58. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  59. *
  60. ************************************************************************************/
  61. $language_data = array (
  62. 'LANG_NAME' => 'DOS',
  63. 'COMMENT_SINGLE' => array(),
  64. 'COMMENT_MULTI' => array(),
  65. //DOS comment lines
  66. 'COMMENT_REGEXP' => array(
  67. 1 => "/^\s*@?REM\b.*$/mi",
  68. 2 => "/^\s*::.*$/m",
  69. 3 => "/\^./"
  70. ),
  71. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  72. 'QUOTEMARKS' => array(),
  73. 'ESCAPE_CHAR' => '',
  74. 'KEYWORDS' => array(
  75. /* Flow control keywords */
  76. 1 => array(
  77. 'if', 'else', 'goto', 'shift',
  78. 'for', 'in', 'do',
  79. 'call', 'exit'
  80. ),
  81. /* IF statement keywords */
  82. 2 => array(
  83. 'not', 'exist', 'errorlevel',
  84. 'defined',
  85. 'equ', 'neq', 'lss', 'leq', 'gtr', 'geq'
  86. ),
  87. /* Internal commands */
  88. 3 => array(
  89. 'cd', 'md', 'rd', 'chdir', 'mkdir', 'rmdir', 'dir',
  90. 'del', 'copy', 'move', 'ren', 'rename',
  91. 'echo',
  92. 'setlocal', 'endlocal', 'set',
  93. 'pause',
  94. 'pushd', 'popd', 'title', 'verify'
  95. ),
  96. /* Special files */
  97. 4 => array(
  98. 'prn', 'nul', 'lpt3', 'lpt2', 'lpt1', 'con',
  99. 'com4', 'com3', 'com2', 'com1', 'aux'
  100. )
  101. ),
  102. 'SYMBOLS' => array(
  103. '(', ')', '@', '%', '!', '|', '<', '>', '&'
  104. ),
  105. 'CASE_SENSITIVE' => array(
  106. GESHI_COMMENTS => false,
  107. 1 => false,
  108. 2 => false,
  109. 3 => false,
  110. 4 => false
  111. ),
  112. 'STYLES' => array(
  113. 'KEYWORDS' => array(
  114. 1 => 'color: #00b100; font-weight: bold;',
  115. 2 => 'color: #000000; font-weight: bold;',
  116. 3 => 'color: #b1b100; font-weight: bold;',
  117. 4 => 'color: #0000ff; font-weight: bold;'
  118. ),
  119. 'COMMENTS' => array(
  120. 1 => 'color: #808080; font-style: italic;',
  121. 2 => 'color: #b100b1; font-style: italic;',
  122. 3 => 'color: #33cc33;'
  123. ),
  124. 'ESCAPE_CHAR' => array(
  125. 0 => 'color: #ff0000; font-weight: bold;'
  126. ),
  127. 'BRACKETS' => array(
  128. 0 => 'color: #66cc66;'
  129. ),
  130. 'STRINGS' => array(
  131. 0 => 'color: #ff0000;'
  132. ),
  133. 'NUMBERS' => array(
  134. 0 => 'color: #cc66cc;'
  135. ),
  136. 'METHODS' => array(
  137. ),
  138. 'SYMBOLS' => array(
  139. 0 => 'color: #33cc33;',
  140. 1 => 'color: #33cc33;'
  141. ),
  142. 'SCRIPT' => array(
  143. ),
  144. 'REGEXPS' => array(
  145. 0 => 'color: #b100b1; font-weight: bold;',
  146. 1 => 'color: #448844;',
  147. 2 => 'color: #448888;',
  148. 3 => 'color: #448888;'
  149. )
  150. ),
  151. 'OOLANG' => false,
  152. 'OBJECT_SPLITTERS' => array(
  153. ),
  154. 'URLS' => array(
  155. 1 => 'http://www.ss64.com/nt/{FNAMEL}.html',
  156. 2 => 'http://www.ss64.com/nt/{FNAMEL}.html',
  157. 3 => 'http://www.ss64.com/nt/{FNAMEL}.html',
  158. 4 => 'http://www.ss64.com/nt/{FNAMEL}.html'
  159. ),
  160. 'REGEXPS' => array(
  161. /* Label */
  162. 0 => array(
  163. /* GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\s\n]*)',*/
  164. GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\s\n]*)',
  165. GESHI_REPLACE => '\\2',
  166. GESHI_MODIFIERS => 'si',
  167. GESHI_BEFORE => '\\1',
  168. GESHI_AFTER => ''
  169. ),
  170. /* Variable assignement */
  171. 1 => array(
  172. /* GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\s\n]+)([\s]*=)',*/
  173. GESHI_SEARCH => '(SET\s+(?si:\\/A\s+|\\/P\s+)?)([^=\n]+)(\s*=)',
  174. GESHI_REPLACE => '\\2',
  175. GESHI_MODIFIERS => 'si',
  176. GESHI_BEFORE => '\\1',
  177. GESHI_AFTER => '\\3'
  178. ),
  179. /* Arguments or variable evaluation */
  180. 2 => array(
  181. /* GESHI_SEARCH => '(%)([\d*]|[^%\s]*(?=%))((?<!%\d)%|)',*/
  182. GESHI_SEARCH => '(!(?:!(?=[a-z0-9]))?)([\d*]|(?:~[adfnpstxz]*(?:$\w+:)?)?[a-z0-9](?!\w)|[^!>\n]*(?=!))((?<!%\d)%|)(?!!>)',
  183. GESHI_REPLACE => '\\2',
  184. GESHI_MODIFIERS => 'si',
  185. GESHI_BEFORE => '\\1',
  186. GESHI_AFTER => '\\3'
  187. ),
  188. /* Arguments or variable evaluation */
  189. 3 => array(
  190. /* GESHI_SEARCH => '(%)([\d*]|[^%\s]*(?=%))((?<!%\d)%|)',*/
  191. GESHI_SEARCH => '(%(?:%(?=[a-z0-9]))?)([\d*]|(?:~[adfnpstxz]*(?:$\w+:)?)?[a-z0-9](?!\w)|[^%\n]*(?=%))((?<!%\d)%|)',
  192. GESHI_REPLACE => '\\2',
  193. GESHI_MODIFIERS => 'si',
  194. GESHI_BEFORE => '\\1',
  195. GESHI_AFTER => '\\3'
  196. )
  197. ),
  198. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  199. 'SCRIPT_DELIMITERS' => array(
  200. ),
  201. 'HIGHLIGHT_STRICT_BLOCK' => array(
  202. ),
  203. 'TAB_WIDTH' => 4,
  204. 'PARSER_CONTROL' => array(
  205. 'ENABLE_FLAGS' => array(
  206. 'BRACKETS' => GESHI_NEVER,
  207. 'NUMBERS' => GESHI_NEVER
  208. ),
  209. 'KEYWORDS' => array(
  210. 1 => array(
  211. 'DISALLOWED_BEFORE' => '(?<![\w\-])'
  212. ),
  213. 2 => array(
  214. 'DISALLOWED_BEFORE' => '(?<![\w\-])'
  215. ),
  216. 3 => array(
  217. 'DISALLOWED_BEFORE' => '(?<![\w\-])'
  218. ),
  219. 4 => array(
  220. 'DISALLOWED_BEFORE' => '(?<!\w)'
  221. )
  222. )
  223. )
  224. );
  225. ?>