line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Simple::Perl; |
2
|
2
|
|
|
2
|
|
152832
|
use strict; |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
72
|
|
3
|
2
|
|
|
2
|
|
16
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
79
|
|
4
|
2
|
|
|
2
|
|
16
|
use base qw(Syntax::Highlight::Engine::Simple); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
944
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
### ---------------------------------------------------------------------------- |
8
|
|
|
|
|
|
|
### set syntax |
9
|
|
|
|
|
|
|
### ---------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
sub setSyntax { |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
shift->{syntax} = |
13
|
|
|
|
|
|
|
[ |
14
|
|
|
|
|
|
|
{ |
15
|
0
|
|
|
0
|
1
|
|
class => 'quote', |
16
|
|
|
|
|
|
|
regexp => '(?
|
17
|
|
|
|
|
|
|
}, |
18
|
|
|
|
|
|
|
{ |
19
|
|
|
|
|
|
|
class => 'quote', |
20
|
|
|
|
|
|
|
regexp => '(?
|
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
{ |
23
|
|
|
|
|
|
|
class => 'quote', |
24
|
|
|
|
|
|
|
regexp => q@'.*?(?
|
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
{ |
27
|
|
|
|
|
|
|
class => 'wquote', |
28
|
|
|
|
|
|
|
regexp => '(?
|
29
|
|
|
|
|
|
|
}, |
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
class => 'wquote', |
32
|
|
|
|
|
|
|
regexp => q@".*?(?
|
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
class => 'comment', |
36
|
|
|
|
|
|
|
regexp => '(?m)#+.*?$', |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
{ |
39
|
|
|
|
|
|
|
class => 'variable', |
40
|
|
|
|
|
|
|
regexp => '[\$\@\%][\w\d:]+', |
41
|
|
|
|
|
|
|
}, |
42
|
|
|
|
|
|
|
{ |
43
|
|
|
|
|
|
|
class => 'function', |
44
|
|
|
|
|
|
|
regexp => '\&[\w\d:]+', |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
class => 'method', |
48
|
|
|
|
|
|
|
regexp => '(?<=->)[\w\d:]+', |
49
|
|
|
|
|
|
|
}, |
50
|
|
|
|
|
|
|
{ |
51
|
|
|
|
|
|
|
class => 'number', |
52
|
|
|
|
|
|
|
regexp => '\b\d+\b', |
53
|
|
|
|
|
|
|
}, |
54
|
|
|
|
|
|
|
{ |
55
|
|
|
|
|
|
|
class => 'keyword', |
56
|
|
|
|
|
|
|
regexp => __PACKAGE__->array2regexp(&getStatementKeywords()), |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
class => 'keyword', |
60
|
|
|
|
|
|
|
regexp => __PACKAGE__->array2regexp(&getKeywords()), |
61
|
|
|
|
|
|
|
}, |
62
|
|
|
|
|
|
|
{ |
63
|
|
|
|
|
|
|
class => 'regexp_statement', |
64
|
|
|
|
|
|
|
regexp => '(?<=(?
|
65
|
|
|
|
|
|
|
}, |
66
|
|
|
|
|
|
|
{ |
67
|
|
|
|
|
|
|
class => 'regexp_statement', |
68
|
|
|
|
|
|
|
regexp => '(?<=(?
|
69
|
|
|
|
|
|
|
}, |
70
|
|
|
|
|
|
|
{ |
71
|
|
|
|
|
|
|
class => 'regexp_statement', |
72
|
|
|
|
|
|
|
regexp => '/.+?/', |
73
|
|
|
|
|
|
|
}, |
74
|
|
|
|
|
|
|
{ |
75
|
|
|
|
|
|
|
class => 'perlpod', |
76
|
|
|
|
|
|
|
regexp => '(?sm)^=.+?(^=cut$)', |
77
|
|
|
|
|
|
|
}, |
78
|
|
|
|
|
|
|
{ |
79
|
|
|
|
|
|
|
class => 'keyword2', |
80
|
|
|
|
|
|
|
regexp => '(?m)^=.+$', |
81
|
|
|
|
|
|
|
container => 'perlpod', |
82
|
|
|
|
|
|
|
}, |
83
|
|
|
|
|
|
|
{ |
84
|
|
|
|
|
|
|
class => 'statement', |
85
|
|
|
|
|
|
|
regexp => '(?m)^=\w+', |
86
|
|
|
|
|
|
|
container => 'keyword2', |
87
|
|
|
|
|
|
|
}, |
88
|
|
|
|
|
|
|
]; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub getStatementKeywords { |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
return ( |
94
|
0
|
|
|
0
|
1
|
|
'continue', |
95
|
|
|
|
|
|
|
'foreach', |
96
|
|
|
|
|
|
|
'require', |
97
|
|
|
|
|
|
|
'package', |
98
|
|
|
|
|
|
|
'scalar', |
99
|
|
|
|
|
|
|
'format', |
100
|
|
|
|
|
|
|
'unless', |
101
|
|
|
|
|
|
|
'local', |
102
|
|
|
|
|
|
|
'until', |
103
|
|
|
|
|
|
|
'while', |
104
|
|
|
|
|
|
|
'elsif', |
105
|
|
|
|
|
|
|
'next', |
106
|
|
|
|
|
|
|
'last', |
107
|
|
|
|
|
|
|
'goto', |
108
|
|
|
|
|
|
|
'else', |
109
|
|
|
|
|
|
|
'redo', |
110
|
|
|
|
|
|
|
'sub', |
111
|
|
|
|
|
|
|
'for', |
112
|
|
|
|
|
|
|
'use', |
113
|
|
|
|
|
|
|
'our', |
114
|
|
|
|
|
|
|
'no', |
115
|
|
|
|
|
|
|
'if', |
116
|
|
|
|
|
|
|
'my', |
117
|
|
|
|
|
|
|
'qr', |
118
|
|
|
|
|
|
|
'qx', |
119
|
|
|
|
|
|
|
# 'qq', |
120
|
|
|
|
|
|
|
# 'qw', |
121
|
|
|
|
|
|
|
# 'tr', |
122
|
|
|
|
|
|
|
# 'm', |
123
|
|
|
|
|
|
|
# 'q', |
124
|
|
|
|
|
|
|
# 's', |
125
|
|
|
|
|
|
|
# 'y' |
126
|
|
|
|
|
|
|
); |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub getKeywords { |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
return ( |
132
|
0
|
|
|
0
|
1
|
|
'getprotobynumber', |
133
|
|
|
|
|
|
|
'getprotobyname', |
134
|
|
|
|
|
|
|
'gethostbyaddr', |
135
|
|
|
|
|
|
|
'gethostbyname', |
136
|
|
|
|
|
|
|
'getservbyname', |
137
|
|
|
|
|
|
|
'getservbyport', |
138
|
|
|
|
|
|
|
'getnetbyaddr', |
139
|
|
|
|
|
|
|
'getnetbyname', |
140
|
|
|
|
|
|
|
'endprotoent', |
141
|
|
|
|
|
|
|
'getpeername', |
142
|
|
|
|
|
|
|
'getpriority', |
143
|
|
|
|
|
|
|
'getprotoent', |
144
|
|
|
|
|
|
|
'getsockname', |
145
|
|
|
|
|
|
|
'setpriority', |
146
|
|
|
|
|
|
|
'setprotoent', |
147
|
|
|
|
|
|
|
'endhostent', |
148
|
|
|
|
|
|
|
'endservent', |
149
|
|
|
|
|
|
|
'gethostent', |
150
|
|
|
|
|
|
|
'getservent', |
151
|
|
|
|
|
|
|
'getsockopt', |
152
|
|
|
|
|
|
|
'sethostent', |
153
|
|
|
|
|
|
|
'setservent', |
154
|
|
|
|
|
|
|
'setsockopt', |
155
|
|
|
|
|
|
|
'socketpair', |
156
|
|
|
|
|
|
|
'endnetent', |
157
|
|
|
|
|
|
|
'getnetent', |
158
|
|
|
|
|
|
|
'localtime', |
159
|
|
|
|
|
|
|
'prototype', |
160
|
|
|
|
|
|
|
'quotemeta', |
161
|
|
|
|
|
|
|
'rewinddir', |
162
|
|
|
|
|
|
|
'setnetent', |
163
|
|
|
|
|
|
|
'wantarray', |
164
|
|
|
|
|
|
|
'closedir', |
165
|
|
|
|
|
|
|
'dbmclose', |
166
|
|
|
|
|
|
|
'endgrent', |
167
|
|
|
|
|
|
|
'endpwent', |
168
|
|
|
|
|
|
|
'formline', |
169
|
|
|
|
|
|
|
'getgrent', |
170
|
|
|
|
|
|
|
'getgrgid', |
171
|
|
|
|
|
|
|
'getgrnam', |
172
|
|
|
|
|
|
|
'getlogin', |
173
|
|
|
|
|
|
|
'getpwent', |
174
|
|
|
|
|
|
|
'getpwnam', |
175
|
|
|
|
|
|
|
'getpwuid', |
176
|
|
|
|
|
|
|
'readline', |
177
|
|
|
|
|
|
|
'readlink', |
178
|
|
|
|
|
|
|
'readpipe', |
179
|
|
|
|
|
|
|
'setgrent', |
180
|
|
|
|
|
|
|
'setpwent', |
181
|
|
|
|
|
|
|
'shmwrite', |
182
|
|
|
|
|
|
|
'shutdown', |
183
|
|
|
|
|
|
|
'syswrite', |
184
|
|
|
|
|
|
|
'truncate', |
185
|
|
|
|
|
|
|
'binmode', |
186
|
|
|
|
|
|
|
'connect', |
187
|
|
|
|
|
|
|
'dbmopen', |
188
|
|
|
|
|
|
|
'defined', |
189
|
|
|
|
|
|
|
'getpgrp', |
190
|
|
|
|
|
|
|
'getppid', |
191
|
|
|
|
|
|
|
'lcfirst', |
192
|
|
|
|
|
|
|
'opendir', |
193
|
|
|
|
|
|
|
'readdir', |
194
|
|
|
|
|
|
|
'reverse', |
195
|
|
|
|
|
|
|
'seekdir', |
196
|
|
|
|
|
|
|
'setpgrp', |
197
|
|
|
|
|
|
|
'shmread', |
198
|
|
|
|
|
|
|
'sprintf', |
199
|
|
|
|
|
|
|
'symlink', |
200
|
|
|
|
|
|
|
'syscall', |
201
|
|
|
|
|
|
|
'sysopen', |
202
|
|
|
|
|
|
|
'sysread', |
203
|
|
|
|
|
|
|
'sysseek', |
204
|
|
|
|
|
|
|
'telldir', |
205
|
|
|
|
|
|
|
'ucfirst', |
206
|
|
|
|
|
|
|
'unshift', |
207
|
|
|
|
|
|
|
'waitpid', |
208
|
|
|
|
|
|
|
'accept', |
209
|
|
|
|
|
|
|
'caller', |
210
|
|
|
|
|
|
|
'chroot', |
211
|
|
|
|
|
|
|
'delete', |
212
|
|
|
|
|
|
|
'exists', |
213
|
|
|
|
|
|
|
'fileno', |
214
|
|
|
|
|
|
|
'gmtime', |
215
|
|
|
|
|
|
|
'import', |
216
|
|
|
|
|
|
|
'length', |
217
|
|
|
|
|
|
|
'listen', |
218
|
|
|
|
|
|
|
'msgctl', |
219
|
|
|
|
|
|
|
'msgget', |
220
|
|
|
|
|
|
|
'msgrcv', |
221
|
|
|
|
|
|
|
'msgsnd', |
222
|
|
|
|
|
|
|
'printf', |
223
|
|
|
|
|
|
|
'rename', |
224
|
|
|
|
|
|
|
'return', |
225
|
|
|
|
|
|
|
'rindex', |
226
|
|
|
|
|
|
|
'select', |
227
|
|
|
|
|
|
|
'semctl', |
228
|
|
|
|
|
|
|
'semget', |
229
|
|
|
|
|
|
|
'shmctl', |
230
|
|
|
|
|
|
|
'shmget', |
231
|
|
|
|
|
|
|
'socket', |
232
|
|
|
|
|
|
|
'splice', |
233
|
|
|
|
|
|
|
'substr', |
234
|
|
|
|
|
|
|
'system', |
235
|
|
|
|
|
|
|
'unlink', |
236
|
|
|
|
|
|
|
'unpack', |
237
|
|
|
|
|
|
|
'values', |
238
|
|
|
|
|
|
|
'alarm', |
239
|
|
|
|
|
|
|
'atan2', |
240
|
|
|
|
|
|
|
'bless', |
241
|
|
|
|
|
|
|
'break', |
242
|
|
|
|
|
|
|
'chdir', |
243
|
|
|
|
|
|
|
'chmod', |
244
|
|
|
|
|
|
|
'chomp', |
245
|
|
|
|
|
|
|
'chown', |
246
|
|
|
|
|
|
|
'close', |
247
|
|
|
|
|
|
|
'crypt', |
248
|
|
|
|
|
|
|
'fcntl', |
249
|
|
|
|
|
|
|
'flock', |
250
|
|
|
|
|
|
|
'index', |
251
|
|
|
|
|
|
|
'ioctl', |
252
|
|
|
|
|
|
|
'lstat', |
253
|
|
|
|
|
|
|
'mkdir', |
254
|
|
|
|
|
|
|
'print', |
255
|
|
|
|
|
|
|
'reset', |
256
|
|
|
|
|
|
|
'rmdir', |
257
|
|
|
|
|
|
|
'semop', |
258
|
|
|
|
|
|
|
'shift', |
259
|
|
|
|
|
|
|
'sleep', |
260
|
|
|
|
|
|
|
'split', |
261
|
|
|
|
|
|
|
'srand', |
262
|
|
|
|
|
|
|
'study', |
263
|
|
|
|
|
|
|
'times', |
264
|
|
|
|
|
|
|
'umask', |
265
|
|
|
|
|
|
|
'undef', |
266
|
|
|
|
|
|
|
'untie', |
267
|
|
|
|
|
|
|
'utime', |
268
|
|
|
|
|
|
|
'write', |
269
|
|
|
|
|
|
|
'bind', |
270
|
|
|
|
|
|
|
'chop', |
271
|
|
|
|
|
|
|
'dump', |
272
|
|
|
|
|
|
|
'each', |
273
|
|
|
|
|
|
|
'eval', |
274
|
|
|
|
|
|
|
'exec', |
275
|
|
|
|
|
|
|
'exit', |
276
|
|
|
|
|
|
|
'fork', |
277
|
|
|
|
|
|
|
'getc', |
278
|
|
|
|
|
|
|
'glob', |
279
|
|
|
|
|
|
|
'grep', |
280
|
|
|
|
|
|
|
'join', |
281
|
|
|
|
|
|
|
'keys', |
282
|
|
|
|
|
|
|
'kill', |
283
|
|
|
|
|
|
|
'link', |
284
|
|
|
|
|
|
|
'open', |
285
|
|
|
|
|
|
|
'pack', |
286
|
|
|
|
|
|
|
'pipe', |
287
|
|
|
|
|
|
|
'push', |
288
|
|
|
|
|
|
|
'rand', |
289
|
|
|
|
|
|
|
'read', |
290
|
|
|
|
|
|
|
'recv', |
291
|
|
|
|
|
|
|
'seek', |
292
|
|
|
|
|
|
|
'send', |
293
|
|
|
|
|
|
|
'sort', |
294
|
|
|
|
|
|
|
'sqrt', |
295
|
|
|
|
|
|
|
'stat', |
296
|
|
|
|
|
|
|
'tell', |
297
|
|
|
|
|
|
|
'tied', |
298
|
|
|
|
|
|
|
'time', |
299
|
|
|
|
|
|
|
'wait', |
300
|
|
|
|
|
|
|
'warn', |
301
|
|
|
|
|
|
|
'abs', |
302
|
|
|
|
|
|
|
'chr', |
303
|
|
|
|
|
|
|
'cos', |
304
|
|
|
|
|
|
|
'die', |
305
|
|
|
|
|
|
|
'eof', |
306
|
|
|
|
|
|
|
'exp', |
307
|
|
|
|
|
|
|
'hex', |
308
|
|
|
|
|
|
|
'int', |
309
|
|
|
|
|
|
|
'log', |
310
|
|
|
|
|
|
|
'map', |
311
|
|
|
|
|
|
|
'oct', |
312
|
|
|
|
|
|
|
'ord', |
313
|
|
|
|
|
|
|
'pop', |
314
|
|
|
|
|
|
|
'pos', |
315
|
|
|
|
|
|
|
'ref', |
316
|
|
|
|
|
|
|
'sin', |
317
|
|
|
|
|
|
|
'tie', |
318
|
|
|
|
|
|
|
'do', |
319
|
|
|
|
|
|
|
'vec', |
320
|
|
|
|
|
|
|
'lc', |
321
|
|
|
|
|
|
|
'uc', |
322
|
|
|
|
|
|
|
); |
323
|
|
|
|
|
|
|
} |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
return 1; |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
__END__ |