Mercurial > vim
annotate runtime/syntax/perl.vim @ 28396:cf018ac0499c
Added tag v8.2.4722 for changeset a0cd2b7a78efd685e5eba7fa2d3833a926669d0a
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 09 Apr 2022 19:00:03 +0200 |
parents | bd021eb62e73 |
children | d1fe80fb35e6 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
2 " Language: Perl 5 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
3 " Maintainer: vim-perl <vim-perl@googlegroups.com> |
20115 | 4 " Homepage: https://github.com/vim-perl/vim-perl/tree/master |
5 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues | |
6 " Last Change: 2020 Apr 15 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
7 " Contributors: Andy Lester <andy@petdance.com> |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
8 " Hinrik Örn Sigurðsson <hinrik.sig@gmail.com> |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
9 " Lukas Mai <l.mai.web.de> |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
10 " Nick Hibma <nick@van-laarhoven.org> |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
11 " Sonia Heimann <niania@netsurf.org> |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
12 " Rob Hoelz <rob@hoelz.ro> |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
13 " and many others. |
7 | 14 " |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
15 " Please download the most recent version first, before mailing |
7 | 16 " any comments. |
17 " | |
18 " The following parameters are available for tuning the | |
19 " perl syntax highlighting, with defaults given: | |
20 " | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
21 " let perl_include_pod = 1 |
2152 | 22 " unlet perl_no_scope_in_variables |
23 " unlet perl_no_extended_vars | |
7 | 24 " unlet perl_string_as_statement |
25 " unlet perl_no_sync_on_sub | |
26 " unlet perl_no_sync_on_global_var | |
27 " let perl_sync_dist = 100 | |
28 " unlet perl_fold | |
29 " unlet perl_fold_blocks | |
5239 | 30 " unlet perl_nofold_packages |
12499 | 31 " unlet perl_nofold_subs |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
32 " unlet perl_fold_anonymous_subs |
12499 | 33 " unlet perl_no_subprototype_error |
7 | 34 |
2548
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
35 if exists("b:current_syntax") |
7 | 36 finish |
37 endif | |
38 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
39 let s:cpo_save = &cpo |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
40 set cpo&vim |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
41 |
7 | 42 " POD starts with ^=<word> and ends with ^=cut |
43 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
44 if !exists("perl_include_pod") || perl_include_pod == 1 |
7 | 45 " Include a while extra syntax file |
46 syn include @Pod syntax/pod.vim | |
47 unlet b:current_syntax | |
48 if exists("perl_fold") | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
49 syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend fold extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
50 syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold extend |
7 | 51 else |
557 | 52 syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend |
7 | 53 syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend |
54 endif | |
55 else | |
56 " Use only the bare minimum of rules | |
57 if exists("perl_fold") | |
1118 | 58 syn region perlPOD start="^=[a-z]" end="^=cut" fold |
7 | 59 else |
1118 | 60 syn region perlPOD start="^=[a-z]" end="^=cut" |
7 | 61 endif |
62 endif | |
63 | |
64 | |
2152 | 65 syn cluster perlTop contains=TOP |
66 | |
5277 | 67 syn region perlBraces start="{" end="}" transparent extend |
2152 | 68 |
7 | 69 " All keywords |
70 " | |
2152 | 71 syn match perlConditional "\<\%(if\|elsif\|unless\|given\|when\|default\)\>" |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
72 syn match perlConditional "\<else\%(\%(\_s\*if\>\)\|\>\)" contains=perlElseIfError skipwhite skipnl skipempty |
2152 | 73 syn match perlRepeat "\<\%(while\|for\%(each\)\=\|do\|until\|continue\)\>" |
74 syn match perlOperator "\<\%(defined\|undef\|eq\|ne\|[gl][et]\|cmp\|not\|and\|or\|xor\|not\|bless\|ref\|do\)\>" | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
75 " for some reason, adding this as the nextgroup for perlControl fixes BEGIN |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
76 " folding issues... |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
77 syn match perlFakeGroup "" contained |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
78 syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>\_s*" nextgroup=perlFakeGroup |
7 | 79 |
2152 | 80 syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>" |
81 syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>" | |
12499 | 82 syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|fc\|uc\%(first\)\=\)\>" |
2152 | 83 syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>" |
84 syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>" | |
85 syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>" | |
86 syn match perlStatementHash "\<\%(delete\|each\|exists\|keys\|values\)\>" | |
87 syn match perlStatementIOfunc "\<\%(syscall\|dbmopen\|dbmclose\)\>" | |
88 syn match perlStatementFiledesc "\<\%(binmode\|close\%(dir\)\=\|eof\|fileno\|getc\|lstat\|printf\=\|read\%(dir\|line\|pipe\)\|rewinddir\|say\|select\|stat\|tell\%(dir\)\=\|write\)\>" nextgroup=perlFiledescStatementNocomma skipwhite | |
89 syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read\|seek\%(dir\)\=\|sys\%(open\|read\|seek\|write\)\|truncate\)\>" nextgroup=perlFiledescStatementComma skipwhite | |
90 syn match perlStatementVector "\<vec\>" | |
91 syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>" | |
92 syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>" | |
12499 | 93 syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>" |
94 syn match perlStatementInclude "\<\%(require\|import\|unimport\)\>" | |
95 syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autodie\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|overloading\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\=" | |
2152 | 96 syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>" |
5239 | 97 syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>" |
2152 | 98 syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>" |
99 syn match perlStatementNetwork "\<\%(\%(end\|[gs]et\)\%(host\|net\|proto\|serv\)ent\|get\%(\%(host\|net\)by\%(addr\|name\)\|protoby\%(name\|number\)\|servby\%(name\|port\)\)\)\>" | |
100 syn match perlStatementPword "\<\%(get\%(pw\%(uid\|nam\)\|gr\%(gid\|nam\)\|login\)\)\|\%(end\|[gs]et\)\%(pw\|gr\)ent\>" | |
101 syn match perlStatementTime "\<\%(gmtime\|localtime\|time\)\>" | |
7 | 102 |
5239 | 103 syn match perlStatementMisc "\<\%(warn\|format\|formline\|reset\|scalar\|prototype\|lock\|tied\=\|untie\)\>" |
2152 | 104 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
105 syn keyword perlTodo TODO TODO: TBD TBD: FIXME FIXME: XXX XXX: NOTE NOTE: contained |
1118 | 106 |
12499 | 107 syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\%(\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*\)\@<={" end="}" transparent extend |
2152 | 108 |
109 syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!" | |
7 | 110 |
111 " Perl Identifiers. | |
112 " | |
113 " Should be cleaned up to better handle identifiers in particular situations | |
114 " (in hash keys for example) | |
115 " | |
116 " Plain identifiers: $foo, @foo, $#foo, %foo, &foo and dereferences $$foo, @$foo, etc. | |
117 " We do not process complex things such as @{${"foo"}}. Too complicated, and | |
118 " too slow. And what is after the -> is *not* considered as part of the | |
119 " variable - there again, too complicated and too slow. | |
120 | |
121 " Special variables first ($^A, ...) and ($|, $', ...) | |
2152 | 122 syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\=" |
1118 | 123 syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]" |
12499 | 124 syn match perlVarPlain "@[-+]" |
2152 | 125 syn match perlVarPlain "$\%(0\|[1-9]\d*\)" |
7 | 126 " Same as above, but avoids confusion in $::foo (equivalent to $main::foo) |
2152 | 127 syn match perlVarPlain "$::\@!" |
7 | 128 " These variables are not recognized within matches. |
129 syn match perlVarNotInMatches "$[|)]" | |
1118 | 130 " This variable is not recognized within matches delimited by m//. |
7 | 131 syn match perlVarSlash "$/" |
132 | |
133 " And plain identifiers | |
2152 | 134 syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\=\%(::\|'\)\I"ms=s+1,me=e-1 contained |
7 | 135 |
2152 | 136 " To not highlight packages in variables as a scope reference - i.e. in |
137 " $pack::var, pack:: is a scope, just set "perl_no_scope_in_variables" | |
138 " If you don't want complex things like @{${"foo"}} to be processed, | |
139 " just set the variable "perl_no_extended_vars"... | |
1118 | 140 |
2152 | 141 if !exists("perl_no_scope_in_variables") |
12499 | 142 syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref |
143 syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref | |
144 syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref | |
7 | 145 else |
12499 | 146 syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref |
147 syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref | |
148 syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref | |
7 | 149 endif |
150 | |
12499 | 151 syn match perlVarPlain2 "%[-+]" |
152 | |
2152 | 153 if !exists("perl_no_extended_vars") |
5239 | 154 syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlBraces |
12499 | 155 syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained |
156 syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained | |
157 syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained | |
158 syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained | |
159 syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained | |
160 syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend | |
161 syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend | |
162 syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend | |
163 syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend | |
164 syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend | |
165 syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contains=perlVarSimpleMemberName contained extend | |
7 | 166 syn match perlVarSimpleMemberName "\I\i*" contained |
12499 | 167 syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend |
168 syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod,perlPostDeref | |
169 syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref | |
170 syn match perlPostDeref "->\%($#\|[$@%&*]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref | |
171 syn region perlPostDeref start="->\%($#\|[$@%&*]\)\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref | |
172 syn region perlPostDeref matchgroup=perlPostDeref start="->\%($#\|[$@%&*]\){" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref | |
7 | 173 endif |
174 | |
175 " File Descriptors | |
2152 | 176 syn match perlFiledescRead "<\h\w*>" |
7 | 177 |
12499 | 178 syn match perlFiledescStatementComma "(\=\s*\<\u\w*\>\s*,"me=e-1 transparent contained contains=perlFiledescStatement |
179 syn match perlFiledescStatementNocomma "(\=\s*\<\u\w*\>\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement | |
7 | 180 |
12499 | 181 syn match perlFiledescStatement "\<\u\w*\>" contained |
7 | 182 |
183 " Special characters in strings and matches | |
2152 | 184 syn match perlSpecialString "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
185 syn match perlSpecialStringU2 "\\." extend contained contains=NONE |
2152 | 186 syn match perlSpecialStringU "\\\\" contained |
187 syn match perlSpecialMatch "\\[1-9]" contained extend | |
188 syn match perlSpecialMatch "\\g\%(\d\+\|{\%(-\=\d\+\|\h\w*\)}\)" contained | |
189 syn match perlSpecialMatch "\\k\%(<\h\w*>\|'\h\w*'\)" contained | |
190 syn match perlSpecialMatch "{\d\+\%(,\%(\d\+\)\=\)\=}" contained | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
191 syn match perlSpecialMatch "\[[]-]\=[^\[\]]*[]-]\=\]" contained extend |
7 | 192 syn match perlSpecialMatch "[+*()?.]" contained |
193 syn match perlSpecialMatch "(?[#:=!]" contained | |
2152 | 194 syn match perlSpecialMatch "(?[impsx]*\%(-[imsx]\+\)\=)" contained |
195 syn match perlSpecialMatch "(?\%([-+]\=\d\+\|R\))" contained | |
196 syn match perlSpecialMatch "(?\%(&\|P[>=]\)\h\w*)" contained | |
197 syn match perlSpecialMatch "(\*\%(\%(PRUNE\|SKIP\|THEN\)\%(:[^)]*\)\=\|\%(MARK\|\):[^)]*\|COMMIT\|F\%(AIL\)\=\|ACCEPT\))" contained | |
7 | 198 |
199 " Possible errors | |
200 " | |
201 " Highlight lines with only whitespace (only in blank delimited here documents) as errors | |
202 syn match perlNotEmptyLine "^\s\+$" contained | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
203 " Highlight "} else if (...) {", it should be "} else { if (...) { " or "} elsif (...) {" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
204 syn match perlElseIfError "else\_s*if" containedin=perlConditional |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
205 syn keyword perlElseIfError elseif containedin=perlConditional |
7 | 206 |
207 " Variable interpolation | |
208 " | |
209 " These items are interpolated inside "" strings and similar constructs. | |
1118 | 210 syn cluster perlInterpDQ contains=perlSpecialString,perlVarPlain,perlVarNotInMatches,perlVarSlash,perlVarBlock |
7 | 211 " These items are interpolated inside '' strings and similar constructs. |
2152 | 212 syn cluster perlInterpSQ contains=perlSpecialStringU,perlSpecialStringU2 |
7 | 213 " These items are interpolated inside m// matches and s/// substitutions. |
2152 | 214 syn cluster perlInterpSlash contains=perlSpecialString,perlSpecialMatch,perlVarPlain,perlVarBlock |
7 | 215 " These items are interpolated inside m## matches and s### substitutions. |
1118 | 216 syn cluster perlInterpMatch contains=@perlInterpSlash,perlVarSlash |
7 | 217 |
218 " Shell commands | |
2152 | 219 syn region perlShellCommand matchgroup=perlMatchStartEnd start="`" end="`" contains=@perlInterpDQ keepend |
7 | 220 |
221 " Constants | |
222 " | |
223 " Numbers | |
2152 | 224 syn match perlNumber "\<\%(0\%(x\x[[:xdigit:]_]*\|b[01][01_]*\|\o[0-7_]*\|\)\|[1-9][[:digit:]_]*\)\>" |
225 syn match perlFloat "\<\d[[:digit:]_]*[eE][\-+]\=\d\+" | |
226 syn match perlFloat "\<\d[[:digit:]_]*\.[[:digit:]_]*\%([eE][\-+]\=\d\+\)\=" | |
5239 | 227 syn match perlFloat "\.[[:digit:]][[:digit:]_]*\%([eE][\-+]\=\d\+\)\=" |
2152 | 228 |
229 syn match perlString "\<\%(v\d\+\%(\.\d\+\)*\|\d\+\%(\.\d\+\)\{2,}\)\>" contains=perlVStringV | |
230 syn match perlVStringV "\<v" contained | |
231 | |
232 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
233 syn region perlParensSQ start=+(+ end=+)+ extend contained contains=perlParensSQ,@perlInterpSQ keepend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
234 syn region perlBracketsSQ start=+\[+ end=+\]+ extend contained contains=perlBracketsSQ,@perlInterpSQ keepend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
235 syn region perlBracesSQ start=+{+ end=+}+ extend contained contains=perlBracesSQ,@perlInterpSQ keepend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
236 syn region perlAnglesSQ start=+<+ end=+>+ extend contained contains=perlAnglesSQ,@perlInterpSQ keepend |
2152 | 237 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
238 syn region perlParensDQ start=+(+ end=+)+ extend contained contains=perlParensDQ,@perlInterpDQ keepend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
239 syn region perlBracketsDQ start=+\[+ end=+\]+ extend contained contains=perlBracketsDQ,@perlInterpDQ keepend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
240 syn region perlBracesDQ start=+{+ end=+}+ extend contained contains=perlBracesDQ,@perlInterpDQ keepend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
241 syn region perlAnglesDQ start=+<+ end=+>+ extend contained contains=perlAnglesDQ,@perlInterpDQ keepend |
7 | 242 |
243 | |
244 " Simple version of searches and matches | |
12499 | 245 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend |
246 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend | |
247 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgcn]*+ contains=@perlInterpSQ keepend extend | |
248 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash keepend extend | |
249 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgcn]*+ contains=@perlInterpMatch,perlParensDQ keepend extend | |
250 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgcn]*+ contains=@perlInterpMatch,perlBracesDQ extend | |
251 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgcn]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend | |
252 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgcn]*+ contains=@perlInterpMatch,perlBracketsDQ keepend extend | |
7 | 253 |
254 " Below some hacks to recognise the // variant. This is virtually impossible to catch in all | |
255 " cases as the / is used in so many other ways, but these should be the most obvious ones. | |
12499 | 256 syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash extend |
7 | 257 |
258 | |
259 " Substitutions | |
260 " perlMatch is the first part, perlSubstitution* is the substitution part | |
5239 | 261 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend extend |
262 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*'+ end=+'+me=e-1 contains=@perlInterpSQ nextgroup=perlSubstitutionSQ keepend extend | |
263 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*/+ end=+/+me=e-1 contains=@perlInterpSlash nextgroup=perlSubstitutionGQQ keepend extend | |
264 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s#+ end=+#+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend extend | |
265 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*(+ end=+)+ contains=@perlInterpMatch,perlParensDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend | |
266 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend | |
267 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
268 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend |
12499 | 269 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcern]*+ keepend contained contains=@perlInterpDQ extend |
270 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend | |
271 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend | |
272 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend | |
273 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend | |
274 syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcern]*+ contained contains=@perlInterpSQ keepend extend | |
7 | 275 |
2152 | 276 " Translations |
7 | 277 " perlMatch is the first part, perlTranslation* is the second, translator part. |
2152 | 278 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\>\s*\z([^[:space:]([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ |
279 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)#+ end=+#+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ | |
280 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl | |
281 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl | |
282 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl | |
283 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
284 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]([{<]\)+ end=+\z1[cdsr]*+ contained |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
285 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+(+ end=+)[cdsr]*+ contains=perlParensSQ contained |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
286 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][cdsr]*+ contains=perlBracketsSQ contained |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
287 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+{+ end=+}[cdsr]*+ contains=perlBracesSQ contained |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
288 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+<+ end=+>[cdsr]*+ contains=perlAnglesSQ contained |
7 | 289 |
290 | |
291 " Strings and q, qq, qw and qr expressions | |
292 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
293 syn region perlStringUnexpanded matchgroup=perlStringStartEnd start="'" end="'" contains=@perlInterpSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
294 syn region perlString matchgroup=perlStringStartEnd start=+"+ end=+"+ contains=@perlInterpDQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
295 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\>\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
296 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q#+ end=+#+ contains=@perlInterpSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
297 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
298 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
299 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
300 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend extend |
2152 | 301 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
302 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\>\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpDQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
303 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]#+ end=+#+ contains=@perlInterpDQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
304 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*(+ end=+)+ contains=@perlInterpDQ,perlParensDQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
305 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*\[+ end=+\]+ contains=@perlInterpDQ,perlBracketsDQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
306 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*{+ end=+}+ contains=@perlInterpDQ,perlBracesDQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
307 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*<+ end=+>+ contains=@perlInterpDQ,perlAnglesDQ keepend extend |
7 | 308 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
309 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
310 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw#+ end=+#+ contains=@perlInterpSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
311 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
312 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
313 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend extend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
314 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend extend |
2152 | 315 |
12499 | 316 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosxdual]*+ contains=@perlInterpMatch keepend extend |
317 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosxdual]*+ contains=@perlInterpSlash keepend extend | |
318 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosxdual]*+ contains=@perlInterpMatch keepend extend | |
319 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosxdual]*+ contains=@perlInterpSQ keepend extend | |
320 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosxdual]*+ contains=@perlInterpMatch,perlParensDQ keepend extend | |
2152 | 321 |
322 " A special case for qr{}, qr<> and qr[] which allows for comments and extra whitespace in the pattern | |
12499 | 323 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosxdual]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend |
324 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosxdual]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend | |
325 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosxdual]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend | |
7 | 326 |
327 " Constructs such as print <<EOF [...] EOF, 'here' documents | |
328 " | |
2152 | 329 " XXX Any statements after the identifier are in perlString colour (i.e. |
330 " 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it | |
331 " seems due to the 'auto-extending nature' of regions. | |
12499 | 332 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+$+ contains=@perlTop oneline |
333 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+$+ contains=@perlTop oneline | |
334 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+$+ contains=@perlTop oneline | |
335 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*""+ end=+$+ contains=@perlTop oneline | |
336 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*''+ end=+$+ contains=@perlTop oneline | |
2152 | 337 if exists("perl_fold") |
12499 | 338 syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend |
339 syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend | |
340 syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend | |
341 syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend | |
342 syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
343 syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend |
7 | 344 else |
12499 | 345 syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ |
346 syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ | |
347 syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ | |
348 syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine | |
349 syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine | |
2152 | 350 syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL |
7 | 351 endif |
352 | |
353 | |
354 " Class declarations | |
355 " | |
2152 | 356 syn match perlPackageDecl "\<package\s\+\%(\h\|::\)\%(\w\|::\)*" contains=perlStatementPackage |
7 | 357 syn keyword perlStatementPackage package contained |
358 | |
359 " Functions | |
360 " sub [name] [(prototype)] { | |
361 " | |
2152 | 362 syn match perlSubError "[^[:space:];{#]" contained |
12499 | 363 syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained |
364 syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ | |
365 syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup | |
366 syn match perlSubAttributes "" contained nextgroup=perlSubError | |
367 syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe | |
368 if get(g:, "perl_sub_signatures", 0) | |
369 syn match perlSignature +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained | |
2152 | 370 else |
12499 | 371 syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained |
372 syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError | |
2152 | 373 endif |
12499 | 374 |
375 syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment | |
7 | 376 |
2152 | 377 syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName |
378 | |
379 " The => operator forces a bareword to the left of it to be interpreted as | |
380 " a string | |
381 syn match perlString "\I\@<!-\?\I\i*\%(\s*=>\)\@=" | |
382 | |
7 | 383 " All other # are comments, except ^#! |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
384 syn match perlComment "#.*" contains=perlTodo,@Spell extend |
7 | 385 syn match perlSharpBang "^#!.*" |
386 | |
387 " Formats | |
1118 | 388 syn region perlFormat matchgroup=perlStatementIOFunc start="^\s*\<format\s\+\k\+\s*=\s*$"rs=s+6 end="^\s*\.\s*$" contains=perlFormatName,perlFormatField,perlVarPlain,perlVarPlain2 |
7 | 389 syn match perlFormatName "format\s\+\k\+\s*="lc=7,me=e-1 contained |
2152 | 390 syn match perlFormatField "[@^][|<>~]\+\%(\.\.\.\)\=" contained |
7 | 391 syn match perlFormatField "[@^]#[#.]*" contained |
392 syn match perlFormatField "@\*" contained | |
393 syn match perlFormatField "@[^A-Za-z_|<>~#*]"me=e-1 contained | |
394 syn match perlFormatField "@$" contained | |
395 | |
396 " __END__ and __DATA__ clauses | |
397 if exists("perl_fold") | |
12499 | 398 syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA fold |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
399 syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA fold |
7 | 400 else |
12499 | 401 syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
402 syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA |
7 | 403 endif |
404 | |
2548
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
405 " |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
406 " Folding |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
407 |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
408 if exists("perl_fold") |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
409 " Note: this bit must come before the actual highlighting of the "package" |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
410 " keyword, otherwise this will screw up Pod lines that match /^package/ |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
411 if !exists("perl_nofold_packages") |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
412 syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
413 endif |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
414 if !exists("perl_nofold_subs") |
12499 | 415 if get(g:, "perl_fold_anonymous_subs", 0) |
416 syn region perlSubFold start="\<sub\>[^{]*{" end="}" transparent fold keepend extend | |
417 syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
418 else |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
419 syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
420 syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
421 endif |
2548
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
422 endif |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
423 |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
424 if exists("perl_fold_blocks") |
12499 | 425 syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)for\%(each\)\=\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend |
2548
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
426 syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
427 endif |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
428 |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
429 setlocal foldmethod=syntax |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
430 syn sync fromstart |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
431 else |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
432 " fromstart above seems to set minlines even if perl_fold is not set. |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
433 syn sync minlines=0 |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
434 endif |
0bb74f626ba7
Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents:
2531
diff
changeset
|
435 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
436 " NOTE: If you're linking new highlight groups to perlString, please also put |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
437 " them into b:match_skip in ftplugin/perl.vim. |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
438 |
2152 | 439 " The default highlighting. |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
440 hi def link perlSharpBang PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
441 hi def link perlControl PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
442 hi def link perlInclude Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
443 hi def link perlSpecial Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
444 hi def link perlString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
445 hi def link perlCharacter Character |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
446 hi def link perlNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
447 hi def link perlFloat Float |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
448 hi def link perlType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
449 hi def link perlIdentifier Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
450 hi def link perlLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
451 hi def link perlStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
452 hi def link perlConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
453 hi def link perlRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
454 hi def link perlOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
455 hi def link perlFunction Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
456 hi def link perlSubName Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
457 hi def link perlSubPrototype Type |
12499 | 458 hi def link perlSignature Type |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
459 hi def link perlSubAttributes PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
460 hi def link perlSubAttributesCont perlSubAttributes |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
461 hi def link perlComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
462 hi def link perlTodo Todo |
2152 | 463 if exists("perl_string_as_statement") |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
464 hi def link perlStringStartEnd perlStatement |
2152 | 465 else |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
466 hi def link perlStringStartEnd perlString |
2152 | 467 endif |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
468 hi def link perlVStringV perlStringStartEnd |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
469 hi def link perlList perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
470 hi def link perlMisc perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
471 hi def link perlVarPlain perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
472 hi def link perlVarPlain2 perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
473 hi def link perlArrow perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
474 hi def link perlFiledescRead perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
475 hi def link perlFiledescStatement perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
476 hi def link perlVarSimpleMember perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
477 hi def link perlVarSimpleMemberName perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
478 hi def link perlVarNotInMatches perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
479 hi def link perlVarSlash perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
480 hi def link perlQQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
481 hi def link perlHereDoc perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
482 hi def link perlStringUnexpanded perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
483 hi def link perlSubstitutionSQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
484 hi def link perlSubstitutionGQQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
485 hi def link perlTranslationGQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
486 hi def link perlMatch perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
487 hi def link perlMatchStartEnd perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
488 hi def link perlFormatName perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
489 hi def link perlFormatField perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
490 hi def link perlPackageDecl perlType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
491 hi def link perlStorageClass perlType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
492 hi def link perlPackageRef perlType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
493 hi def link perlStatementPackage perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
494 hi def link perlStatementStorage perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
495 hi def link perlStatementControl perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
496 hi def link perlStatementScalar perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
497 hi def link perlStatementRegexp perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
498 hi def link perlStatementNumeric perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
499 hi def link perlStatementList perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
500 hi def link perlStatementHash perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
501 hi def link perlStatementIOfunc perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
502 hi def link perlStatementFiledesc perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
503 hi def link perlStatementVector perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
504 hi def link perlStatementFiles perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
505 hi def link perlStatementFlow perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
506 hi def link perlStatementInclude perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
507 hi def link perlStatementProc perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
508 hi def link perlStatementSocket perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
509 hi def link perlStatementIPC perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
510 hi def link perlStatementNetwork perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
511 hi def link perlStatementPword perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
512 hi def link perlStatementTime perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
513 hi def link perlStatementMisc perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
514 hi def link perlStatementIndirObj perlStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
515 hi def link perlFunctionName perlIdentifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
516 hi def link perlMethod perlIdentifier |
12499 | 517 hi def link perlPostDeref perlIdentifier |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
518 hi def link perlFunctionPRef perlType |
12499 | 519 if !get(g:, 'perl_include_pod', 1) |
520 hi def link perlPOD perlComment | |
521 endif | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
522 hi def link perlShellCommand perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
523 hi def link perlSpecialAscii perlSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
524 hi def link perlSpecialDollar perlSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
525 hi def link perlSpecialString perlSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
526 hi def link perlSpecialStringU perlSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
527 hi def link perlSpecialMatch perlSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
528 hi def link perlDATA perlComment |
1118 | 529 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
530 " NOTE: Due to a bug in Vim (or more likely, a misunderstanding on my part), |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
531 " I had to remove the transparent property from the following regions |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
532 " in order to get them to highlight correctly. Feel free to remove |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
533 " these and reinstate the transparent property if you know how. |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
534 hi def link perlParensSQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
535 hi def link perlBracketsSQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
536 hi def link perlBracesSQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
537 hi def link perlAnglesSQ perlString |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
538 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
539 hi def link perlParensDQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
540 hi def link perlBracketsDQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
541 hi def link perlBracesDQ perlString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
542 hi def link perlAnglesDQ perlString |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
543 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
544 hi def link perlSpecialStringU2 perlString |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
545 |
2152 | 546 " Possible errors |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
547 hi def link perlNotEmptyLine Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
548 hi def link perlElseIfError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
549 hi def link perlSubPrototypeError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
5277
diff
changeset
|
550 hi def link perlSubError Error |
1118 | 551 |
7 | 552 " Syncing to speed up processing |
553 " | |
554 if !exists("perl_no_sync_on_sub") | |
555 syn sync match perlSync grouphere NONE "^\s*\<package\s" | |
2152 | 556 syn sync match perlSync grouphere NONE "^\s*\<sub\>" |
7 | 557 syn sync match perlSync grouphere NONE "^}" |
558 endif | |
559 | |
560 if !exists("perl_no_sync_on_global_var") | |
561 syn sync match perlSync grouphere NONE "^$\I[[:alnum:]_:]+\s*=\s*{" | |
562 syn sync match perlSync grouphere NONE "^[@%]\I[[:alnum:]_:]+\s*=\s*(" | |
563 endif | |
564 | |
565 if exists("perl_sync_dist") | |
566 execute "syn sync maxlines=" . perl_sync_dist | |
567 else | |
568 syn sync maxlines=100 | |
569 endif | |
570 | |
571 syn sync match perlSyncPOD grouphere perlPOD "^=pod" | |
572 syn sync match perlSyncPOD grouphere perlPOD "^=head" | |
573 syn sync match perlSyncPOD grouphere perlPOD "^=item" | |
574 syn sync match perlSyncPOD grouphere NONE "^=cut" | |
575 | |
576 let b:current_syntax = "perl" | |
577 | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
578 let &cpo = s:cpo_save |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
579 unlet s:cpo_save |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2548
diff
changeset
|
580 |
2152 | 581 " XXX Change to sts=4:sw=4 |
582 " vim:ts=8:sts=2:sw=2:expandtab:ft=vim |