PageRenderTime 30ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/application/lib/geshi/geshi/perl.php

https://github.com/GCheung55/mootools-website
PHP | 167 lines | 119 code | 2 blank | 46 comment | 0 complexity | c863e9ca4523f787a619a34ad31fa49c MD5 | raw file
  1. <?php
  2. /*************************************************************************************
  3. * perl.php
  4. * --------
  5. * Author: Andreas Gohr (andi@splitbrain.org), Ben Keen (ben.keen@gmail.com)
  6. * Copyright: (c) 2004 Andreas Gohr, Ben Keen (http://www.benjaminkeen.org/), Nigel McNie (http://qbnz.com/highlighter/)
  7. * Release Version: 1.0.7.20
  8. * Date Started: 2004/08/20
  9. *
  10. * Perl language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2006/01/05 (1.0.2)
  15. * - Used hardescape feature for ' strings (Cliff Stanford)
  16. * 2004/11/27 (1.0.1)
  17. * - Added support for multiple object splitters
  18. * 2004/08/20 (1.0.0)
  19. * - First Release
  20. *
  21. * TODO (updated 2004/11/27)
  22. * -------------------------
  23. * * LABEL:
  24. * * string comparison operators
  25. *
  26. *************************************************************************************
  27. *
  28. * This file is part of GeSHi.
  29. *
  30. * GeSHi is free software; you can redistribute it and/or modify
  31. * it under the terms of the GNU General Public License as published by
  32. * the Free Software Foundation; either version 2 of the License, or
  33. * (at your option) any later version.
  34. *
  35. * GeSHi is distributed in the hope that it will be useful,
  36. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38. * GNU General Public License for more details.
  39. *
  40. * You should have received a copy of the GNU General Public License
  41. * along with GeSHi; if not, write to the Free Software
  42. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  43. *
  44. ************************************************************************************/
  45. $language_data = array (
  46. 'LANG_NAME' => 'Perl',
  47. 'COMMENT_SINGLE' => array(1 => '#'),
  48. 'COMMENT_MULTI' => array( '=pod' => '=cut'),
  49. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  50. 'QUOTEMARKS' => array('"'),
  51. 'HARDQUOTE' => array("'", "'"), // An optional 2-element array defining the beginning and end of a hard-quoted string
  52. 'HARDESCAPE' => array('\\\'', "\\\\"), // Things that must still be escaped inside a hard-quoted string
  53. // If HARDQUOTE is defined, HARDESCAPE must be defined
  54. // This will not work unless the first character of each element is either in the
  55. // QUOTEMARKS array or is the ESCAPE_CHAR
  56. 'ESCAPE_CHAR' => '\\',
  57. 'KEYWORDS' => array(
  58. 1 => array(
  59. 'case', 'do', 'else', 'elsif', 'for', 'if', 'then', 'until', 'while', 'foreach', 'my',
  60. 'or', 'and', 'unless', 'next', 'last', 'redo', 'not', 'our',
  61. 'reset', 'continue','and', 'cmp', 'ne'
  62. ),
  63. 2 => array(
  64. 'use', 'sub', 'new', '__END__', '__DATA__', '__DIE__', '__WARN__', 'BEGIN',
  65. 'STDIN', 'STDOUT', 'STDERR'
  66. ),
  67. 3 => array(
  68. 'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless',
  69. 'caller', 'chdir', 'chmod', 'chomp', 'chop', 'chown', 'chr',
  70. 'chroot', 'close', 'closedir', 'connect', 'continue', 'cos',
  71. 'crypt', 'dbmclose', 'dbmopen', 'defined', 'delete', 'die',
  72. 'dump', 'each', 'endgrent', 'endhostent', 'endnetent', 'endprotoent',
  73. 'endpwent', 'endservent', 'eof', 'eval', 'exec', 'exists', 'exit',
  74. 'exp', 'fcntl', 'fileno', 'flock', 'fork', 'format', 'formline',
  75. 'getc', 'getgrent', 'getgrgid', 'getgrnam', 'gethostbyaddr',
  76. 'gethostbyname', 'gethostent', 'getlogin', 'getnetbyaddr', 'getnetbyname',
  77. 'getnetent', 'getpeername', 'getpgrp', 'getppid', 'getpriority',
  78. 'getprotobyname', 'getprotobynumber', 'getprotoent', 'getpwent',
  79. 'getpwnam', 'getpwuid', 'getservbyname', 'getservbyport', 'getservent',
  80. 'getsockname', 'getsockopt', 'glob', 'gmtime', 'goto', 'grep',
  81. 'hex', 'import', 'index', 'int', 'ioctl', 'join', 'keys', 'kill',
  82. 'last', 'lc', 'lcfirst', 'length', 'link', 'listen', 'local',
  83. 'localtime', 'log', 'lstat', 'm', 'map', 'mkdir', 'msgctl', 'msgget',
  84. 'msgrcv', 'msgsnd', 'my', 'next', 'no', 'oct', 'open', 'opendir',
  85. 'ord', 'our', 'pack', 'package', 'pipe', 'pop', 'pos', 'print',
  86. 'printf', 'prototype', 'push', 'qq', 'qr', 'quotemeta', 'qw',
  87. 'qx', 'q', 'rand', 'read', 'readdir', 'readline', 'readlink', 'readpipe',
  88. 'recv', 'redo', 'ref', 'rename', 'require', 'return',
  89. 'reverse', 'rewinddir', 'rindex', 'rmdir', 's', 'scalar', 'seek',
  90. 'seekdir', 'select', 'semctl', 'semget', 'semop', 'send', 'setgrent',
  91. 'sethostent', 'setnetent', 'setpgrp', 'setpriority', 'setprotoent',
  92. 'setpwent', 'setservent', 'setsockopt', 'shift', 'shmctl', 'shmget',
  93. 'shmread', 'shmwrite', 'shutdown', 'sin', 'sleep', 'socket', 'socketpair',
  94. 'sort', 'splice', 'split', 'sprintf', 'sqrt', 'srand', 'stat',
  95. 'study', 'substr', 'symlink', 'syscall', 'sysopen', 'sysread',
  96. 'sysseek', 'system', 'syswrite', 'tell', 'telldir', 'tie', 'tied',
  97. 'time', 'times', 'tr', 'truncate', 'uc', 'ucfirst', 'umask', 'undef',
  98. 'unlink', 'unpack', 'unshift', 'untie', 'utime', 'values',
  99. 'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write', 'y'
  100. )
  101. ),
  102. 'SYMBOLS' => array(
  103. '(', ')', '[', ']', '!', '@', '%', '&', '*', '|', '/', '<', '>'
  104. ),
  105. 'CASE_SENSITIVE' => array(
  106. GESHI_COMMENTS => true,
  107. 1 => true,
  108. 2 => true,
  109. 3 => true,
  110. ),
  111. 'STYLES' => array(
  112. 'KEYWORDS' => array(
  113. 1 => 'color: #b1b100;',
  114. 2 => 'color: #000000; font-weight: bold;',
  115. 3 => 'color: #000066;'
  116. ),
  117. 'COMMENTS' => array(
  118. 1 => 'color: #808080; font-style: italic;',
  119. 'MULTI' => 'color: #808080; font-style: italic;'
  120. ),
  121. 'ESCAPE_CHAR' => array(
  122. 0 => 'color: #000099; font-weight: bold;'
  123. ),
  124. 'BRACKETS' => array(
  125. 0 => 'color: #66cc66;'
  126. ),
  127. 'STRINGS' => array(
  128. 0 => 'color: #ff0000;'
  129. ),
  130. 'NUMBERS' => array(
  131. 0 => 'color: #cc66cc;'
  132. ),
  133. 'METHODS' => array(
  134. 1 => 'color: #006600;',
  135. 2 => 'color: #006600;'
  136. ),
  137. 'SYMBOLS' => array(
  138. 0 => 'color: #66cc66;'
  139. ),
  140. 'REGEXPS' => array(
  141. 0 => 'color: #0000ff;',
  142. 4 => 'color: #009999;',
  143. ),
  144. 'SCRIPT' => array(
  145. )
  146. ),
  147. 'URLS' => array(
  148. 3 => 'http://perldoc.perl.org/functions/{FNAME}.html'
  149. ),
  150. 'OOLANG' => true,
  151. 'OBJECT_SPLITTERS' => array(
  152. 1 => '-&gt;',
  153. 2 => '::'
  154. ),
  155. 'REGEXPS' => array(
  156. 0 => '[\\$%@]+[a-zA-Z_][a-zA-Z0-9_]*',
  157. 4 => '&lt;[a-zA-Z_][a-zA-Z0-9_]*&gt;',
  158. ),
  159. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  160. 'SCRIPT_DELIMITERS' => array(
  161. ),
  162. 'HIGHLIGHT_STRICT_BLOCK' => array(
  163. )
  164. );
  165. ?>