A tumblelog CMS built on AJAX, PHP and MySQL.

bash.php 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <?php
  2. /*************************************************************************************
  3. * bash.php
  4. * --------
  5. * Author: Andreas Gohr (andi@splitbrain.org)
  6. * Copyright: (c) 2004 Andreas Gohr, Nigel McNie (http://qbnz.com/highlighter)
  7. * Release Version: 1.0.7.21
  8. * Date Started: 2004/08/20
  9. *
  10. * BASH language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2007/09/05 (1.0.7.21)
  15. * - PARSER_CONTROL patch using SF #1788408 (BenBE)
  16. * 2007/06/11 (1.0.7.20)
  17. * - Added a lot of keywords (BenBE / Jan G)
  18. * 2004/11/27 (1.0.2)
  19. * - Added support for multiple object splitters
  20. * 2004/10/27 (1.0.1)
  21. * - Added support for URLs
  22. * 2004/08/20 (1.0.0)
  23. * - First Release
  24. *
  25. * TODO (updated 2004/11/27)
  26. * -------------------------
  27. * * Get symbols working
  28. * * Highlight builtin vars
  29. *
  30. *************************************************************************************
  31. *
  32. * This file is part of GeSHi.
  33. *
  34. * GeSHi is free software; you can redistribute it and/or modify
  35. * it under the terms of the GNU General Public License as published by
  36. * the Free Software Foundation; either version 2 of the License, or
  37. * (at your option) any later version.
  38. *
  39. * GeSHi is distributed in the hope that it will be useful,
  40. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  41. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  42. * GNU General Public License for more details.
  43. *
  44. * You should have received a copy of the GNU General Public License
  45. * along with GeSHi; if not, write to the Free Software
  46. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  47. *
  48. ************************************************************************************/
  49. $language_data = array (
  50. 'LANG_NAME' => 'Bash',
  51. // Bash DOES have single line comments with # markers. But bash also has
  52. // the $# variable, so comments need special handling (see sf.net
  53. // 1564839)
  54. 'COMMENT_SINGLE' => array('#'),
  55. 'COMMENT_MULTI' => array(),
  56. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  57. 'QUOTEMARKS' => array("'", '"'),
  58. 'ESCAPE_CHAR' => '\\',
  59. 'KEYWORDS' => array(
  60. 1 => array(
  61. 'case', 'do', 'done', 'elif', 'else', 'esac', 'fi', 'for', 'function',
  62. 'if', 'in', 'select', 'set', 'then', 'until', 'while', 'time'
  63. ),
  64. 2 => array(
  65. 'aclocal', 'aconnect', 'aplay', 'apm', 'apmsleep', 'apropos',
  66. 'ar', 'arch', 'arecord', 'as', 'as86', 'autoconf', 'autoheader',
  67. 'automake', 'awk',
  68. 'basename', 'bc', 'bison', 'bunzip2', 'bzip2', 'bzcat',
  69. 'bzcmp', 'bzdiff', 'bzegrep', 'bzegrep', 'bzfgrep', 'bzgrep',
  70. 'bzip2', 'bzip2recover', 'bzless', 'bzmore',
  71. 'c++', 'cal', 'cat', 'chattr', 'cc', 'cdda2wav', 'cdparanoia',
  72. 'cdrdao', 'cd-read', 'cdrecord', 'chfn', 'chgrp', 'chmod',
  73. 'chown', 'chroot', 'chsh', 'chvt', 'clear', 'cmp', 'comm', 'co',
  74. 'col', 'cp', 'cpio', 'cpp', 'cut',
  75. 'date', 'dd', 'dc', 'dcop', 'deallocvt', 'df', 'diff', 'diff3', 'dir',
  76. 'dircolors', 'directomatic', 'dirname', 'dmesg',
  77. 'dnsdomainname', 'domainname', 'du', 'dumpkeys',
  78. 'ed', 'egrep', 'env', 'expr',
  79. 'false', 'fbset', 'fgconsole','fgrep', 'find', 'file', 'flex', 'flex++',
  80. 'fmt', 'free', 'ftp', 'funzip', 'fuser',
  81. 'g++', 'gawk', 'gc','gcc', 'gdb', 'getent', 'getkeycodes',
  82. 'getopt', 'gettext', 'gettextize', 'gimp', 'gimp-remote',
  83. 'gimptool', 'gmake', 'gocr', 'grep', 'groups', 'gs', 'gunzip',
  84. 'gzexe', 'gzip',
  85. 'head', 'hexdump', 'hostname',
  86. 'id', 'igawk', 'install',
  87. 'join',
  88. 'kbd_mode','kbdrate', 'kdialog', 'kfile', 'kill', 'killall',
  89. 'last', 'lastb', 'ld', 'ld86', 'ldd', 'less', 'lex', 'link', 'ln', 'loadkeys',
  90. 'loadunimap', 'locate', 'lockfile', 'login', 'logname',
  91. 'lp', 'lpr', 'ls', 'lsattr', 'lsmod', 'lsmod.old', 'lynx',
  92. 'm4', 'make', 'man', 'mapscrn', 'mesg', 'mkdir', 'mkfifo',
  93. 'mknod', 'mktemp', 'more', 'mount', 'msgfmt', 'mv',
  94. 'namei', 'nano', 'nasm', 'nawk', 'netstat', 'nice',
  95. 'nisdomainname', 'nl', 'nm', 'nm86', 'nmap', 'nohup', 'nop',
  96. 'od', 'openvt',
  97. 'passwd', 'patch', 'pcregrep', 'pcretest', 'perl', 'perror',
  98. 'pgawk', 'pidof', 'ping', 'pr', 'procmail', 'prune', 'ps', 'pstree',
  99. 'ps2ascii', 'ps2epsi', 'ps2frag', 'ps2pdf', 'ps2ps', 'psbook',
  100. 'psmerge', 'psnup', 'psresize', 'psselect', 'pstops',
  101. 'rbash', 'rcs', 'read', 'readlink', 'red', 'resizecons', 'rev', 'rm',
  102. 'rmdir', 'run-parts',
  103. 'sash', 'sed', 'setfont', 'setkeycodes', 'setleds',
  104. 'setmetamode', 'setserial', 'scp', 'seq', 'setterm', 'sh',
  105. 'showkey', 'shred', 'size', 'size86', 'skill', 'sleep', 'slogin',
  106. 'snice', 'sort', 'sox', 'split', 'ssed', 'ssh', 'ssh-add',
  107. 'ssh-agent', 'ssh-keygen', 'ssh-keyscan', 'stat', 'strings',
  108. 'strip', 'stty', 'su', 'sudo', 'suidperl', 'sum', 'sync',
  109. 'tac', 'tail', 'tar', 'tee', 'tempfile', 'touch', 'tr', 'true',
  110. 'umount', 'uname', 'unicode_start', 'unicode_stop', 'uniq',
  111. 'unlink', 'unzip', 'updatedb', 'updmap', 'uptime', 'users',
  112. 'utmpdump', 'uuidgen',
  113. 'vdir', 'vmstat',
  114. 'w', 'wall', 'wc', 'wget', 'whatis', 'whereis', 'which', 'who',
  115. 'whoami', 'write',
  116. 'xargs', 'xhost', 'xmodmap', 'xset',
  117. 'yacc', 'yes', 'ypdomainname',
  118. 'zcat', 'zcmp', 'zdiff', 'zegrep', 'zfgrep', 'zforce', 'zgrep',
  119. 'zip', 'zless', 'zmore', 'znew', 'zsh', ' zsoelim'
  120. ),
  121. 3 => array(
  122. 'alias', 'bg', 'bind', 'break', 'builtin', 'cd', 'command',
  123. 'compgen', 'complete', 'continue', 'declare', 'dirs', 'disown',
  124. 'echo', 'enable', 'eval', 'exec', 'exit', 'export', 'fc',
  125. 'fg', 'getopts', 'hash', 'help', 'history', 'jobs', 'kill', 'let',
  126. 'local', 'logout', 'popd', 'printf', 'pushd', 'pwd', 'readonly',
  127. 'return', 'shift', 'shopt', 'source', 'suspend', 'test', 'times',
  128. 'trap', 'type', 'typeset', 'ulimit', 'umask', 'unalias', 'unset',
  129. 'wait'
  130. )
  131. ),
  132. 'SYMBOLS' => array(
  133. '(', ')', '[', ']', '!', '@', '%', '&', '*', '|', '/', '<', '>', ';;'
  134. ),
  135. 'CASE_SENSITIVE' => array(
  136. GESHI_COMMENTS => false,
  137. 1 => true,
  138. 2 => true,
  139. 3 => true
  140. ),
  141. 'STYLES' => array(
  142. 'KEYWORDS' => array(
  143. 1 => 'color: #000000; font-weight: bold;',
  144. 2 => 'color: #c20cb9; font-weight: bold;',
  145. 3 => 'color: #7a0874; font-weight: bold;'
  146. ),
  147. 'COMMENTS' => array(
  148. 0 => 'color: #808080; font-style: italic;'
  149. ),
  150. 'ESCAPE_CHAR' => array(
  151. 0 => 'color: #000099; font-weight: bold;'
  152. ),
  153. 'BRACKETS' => array(
  154. 0 => 'color: #7a0874; font-weight: bold;'
  155. ),
  156. 'STRINGS' => array(
  157. 0 => 'color: #ff0000;'
  158. ),
  159. 'NUMBERS' => array(
  160. 0 => 'color: #000000;'
  161. ),
  162. 'METHODS' => array(
  163. ),
  164. 'SYMBOLS' => array(
  165. 0 => 'color: #000000; font-weight: bold;'
  166. ),
  167. 'REGEXPS' => array(
  168. 0 => 'color: #007800;',
  169. 1 => 'color: #007800;',
  170. 2 => 'color: #007800;',
  171. // 3 => 'color: #808080; font-style: italic;',
  172. 4 => 'color: #007800;'
  173. ),
  174. 'SCRIPT' => array(
  175. )
  176. ),
  177. 'URLS' => array(
  178. 1 => '',
  179. 2 => '',
  180. 3 => ''
  181. ),
  182. 'OOLANG' => false,
  183. 'OBJECT_SPLITTERS' => array(
  184. ),
  185. 'REGEXPS' => array(
  186. 0 => "\\$\\{[a-zA-Z_][a-zA-Z0-9_]*?\\}",
  187. 1 => "\\$[a-zA-Z_][a-zA-Z0-9_]*",
  188. 2 => "([a-zA-Z_][a-zA-Z0-9_]*)=",
  189. // 3 => "(?<!\\$)#[^\n]*",
  190. 4 => "\\$[*#\$\\-\\?!]"
  191. ),
  192. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  193. 'SCRIPT_DELIMITERS' => array(
  194. ),
  195. 'HIGHLIGHT_STRICT_BLOCK' => array(
  196. ),
  197. 'PARSER_CONTROL' => array(
  198. 'COMMENTS' => array(
  199. 'DISALLOWED_BEFORE' => '$'
  200. )
  201. )
  202. );
  203. ?>