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