3 * Description: Perl programming language.
5 * Author: Jim Villani, Logistics Management Institute (jvillani@lmi.org)
6 * perl_pod mods by Gregor Purdy (gregor@focusresearch.com)
9 state perl_pod extends Highlight
20 state perl_comment extends Highlight
28 state perl_dquot_string extends Highlight
39 state perl_quot_string extends Highlight
50 state perl_bquot_string extends Highlight
61 state perl extends HighlightEntry
70 /* Ignore escaped quote marks */
81 /* stuff after a -> is a method,
82 * don't bold just because it looks like a keyword
88 /* stuff between a - and a => is a named parameter,
89 * don't bold just because it looks like a keyword
95 /* In cgi files, JavaScript might be embedded, so we need to look out
96 * for the JavaScript comments, because they might contain something
97 * we don't like, like a contraction (don't, won't, etc.)
98 * We won't put them in comment face, because they are not perl
106 /* String constants. */
110 call (perl_dquot_string);
116 call (perl_quot_string);
120 /* Backquoted command string */
124 call (perl_bquot_string);
130 keyword_face (false);
134 /* Keywords. From perl distribution's toke.c
135 abs accept alarm and atan2 bind binmode bless caller chdir chmod
136 chomp chop chown chr chroot close closedir cmp connect continue cos
137 crypt dbmclose dbmopen defined delete die do dump each else elsif
138 endgrent endhostent endnetent endprotoent endpwent endservent eof
139 eq eval exec exists exit exp fcntl fileno flock for foreach fork
140 format formline ge getc getgrent getgrgid getgrnam gethostbyaddr
141 gethostbyname gethostent getlogin getnetbyaddr getnetbyname
142 getnetent getpeername getpgrp getppid getpriority getprotobyname
143 getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname
144 getservbyport getservent getsockname getsockopt glob gmtime goto
145 grep gt hex if index int ioctl join keys kill last lc lcfirst le
146 length link listen local localtime log lstat lt m map mkdir msgctl
147 msgget msgrcv msgsnd my ne new next no not oct open opendir or ord
148 pack package pipe pop pos print printf prototype push q qq quotemeta
149 qw qx rand read readdir readline readlink readpipe recv redo ref
150 rename require reset return reverse rewinddir rindex rmdir s scalar
151 seek seekdir select semctl semget semop send setgrent sethostent
152 setnetent setpgrp setpriority setprotoent setpwent setservent
153 setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep
154 socket socketpair sort splice split sprintf sqrt srand stat study
155 sub substr symlink syscall sysopen sysread sysseek system syswrite
156 tell telldir tie tied time times tr truncate uc ucfirst umask undef
157 unless unlink unpack unshift untie until use utime values vec wait
158 waitpid wantarray warn while write x xor y
160 /\b(a(bs|ccept|larm|nd|tan2)|b(in(d|mode)|less)|c(aller|h(dir|mod\
161 |o(mp|p|wn)|r(|oot))|lose(|dir)|mp|o(n(nect|tinue)|s)|rypt)\
162 |d(bm(close|open)|e(fined|lete)|ie|o|ump)|e(ach|ls(e|if)|nd(gr|host|net|proto\
163 |pw|serv)ent|of|q|val|x(ec|i(sts|t)|p))|f(cntl|ileno|lock|or(|each|k\
164 |m(at|line)))|g(e(|t(c|gr(ent|gid|nam)|host(by(addr|name)|ent)|login\
165 |net(by(addr|name)|ent)|p(eername|grp|pid|riority|roto(by(addr|name|number)\
166 |ent)|w(ent|nam|uid))|s(erv(by(name|port)|ent)|ock(name|opt))))|lob|mtime\
167 |oto|rep|t)|hex|i(f|n(t|dex)|octl)|join|k(eys|ill)|l(ast|c(|first)|e(|ngth)\
168 |i(nk|sten)|o(cal(|time)|g)|stat|t)|m|m(ap|kdir|sg(ctl|get|rcv|snd)|y)\
169 |n(e(|w|xt)|o(|t))|o(ct|pen(|dir)|r(|d))|p(ack(|age)|ipe|o(p|s)|r(int(|f)\
170 |ototype)|ush)|q(|q|uotemeta|w|x)|r(and|e(a(d(|dir|lin(e|k)|pipe))|cv\
171 |do|f|name|quire|set|turn|verse|winddir)|index|mdir)|s(|calar|e(e(k|kdir)\
172 |lect|m(ctl|get|op)|nd|t((gr|host|net)ent|p(grp|r(iority|otoent)|went)\
173 |s(ervent|ockopt)))|h(ift|m(ctl|get|read|write)|utdown)|in|leep|o(cke(t|tpair)\
174 |rt)|p(li(ce|t)|rintf)|qrt|rand|t(at|udy)|u(b|bstr)|y(mlink|s(call|open|read\
175 |s(eek|tem)|write)))|t(ell(|dir)|i(e|ed|m(e|es))|r(|uncate))|u(c(|first)\
176 |mask|n(def|l(ess|ink)|pack|shift|ti(e|l))|se|time)|v(alues|ec)|w(a(i(t(|pid))\
177 |ntarray|rn)|hile|rite)|x(|or)|y)\b/ {
181 keyword_face (false);
185 /^=(pod|head1|head2|item|over|back|for|begin|end)\b.*$/ {