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