annotate runtime/syntax/perl.vim @ 33865:8cdb69ea3711 v9.0.2143

patch 9.0.2143: [security]: buffer-overflow in ex_substitute Commit: https://github.com/vim/vim/commit/abfa13ebe92d81aaf66669c428d767847b577453 Author: Christian Brabandt <cb@256bit.org> Date: Thu Nov 30 11:32:18 2023 +0100 patch 9.0.2143: [security]: buffer-overflow in ex_substitute Problem: [security]: buffer-overflow in ex_substitute Solution: clear memory after allocating When allocating the new_start pointer in ex_substitute() the memory pointer points to some garbage that the following for loop in ex_cmds.c:4743 confuses and causes it to accessing the new_start pointer beyond it's size, leading to a buffer-overlow. So fix this by using alloc_clear() instead of alloc(), which will clear the memory by NUL and therefore cause the loop to terminate correctly. Reported by @henices, thanks! closes: #13596 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Dec 2023 15:16:05 +0100
parents 1e9e9d89f0ee
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
2 " Language: Perl
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
3 " Maintainer: vim-perl <vim-perl@googlegroups.com>
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
4 " Homepage: https://github.com/vim-perl/vim-perl
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
5 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
6 " License: Vim License (see :help license)
29193
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
7 " Last Change: 2022 Jun 13
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
8 " Contributors: Andy Lester <andy@petdance.com>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
9 " Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
10 " Lukas Mai <l.mai.web.de>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
11 " Nick Hibma <nick@van-laarhoven.org>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
12 " Sonia Heimann <niania@netsurf.org>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
13 " Rob Hoelz <rob@hoelz.ro>
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
14 " Doug Kearns <dougkearns@gmail.com>
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
15 " and many others.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 "
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
17 " Please download the most recent version first, before mailing
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " any comments.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " The following parameters are available for tuning the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " perl syntax highlighting, with defaults given:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 "
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
23 " let perl_include_pod = 1
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
24 " unlet perl_no_scope_in_variables
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
25 " unlet perl_no_extended_vars
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " unlet perl_string_as_statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " unlet perl_no_sync_on_sub
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " unlet perl_no_sync_on_global_var
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " let perl_sync_dist = 100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " unlet perl_fold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " unlet perl_fold_blocks
5239
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
32 " unlet perl_nofold_packages
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
33 " unlet perl_nofold_subs
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
34 " unlet perl_fold_anonymous_subs
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
35 " unlet perl_no_subprototype_error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
2548
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
37 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
41 let s:cpo_save = &cpo
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
42 set cpo&vim
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
43
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " POD starts with ^=<word> and ends with ^=cut
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
46 if get(g:, 'perl_include_pod', 1)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " Include a while extra syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn include @Pod syntax/pod.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 unlet b:current_syntax
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
50 if get(g:, 'perl_fold', 1)
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
51 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
52 syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold extend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 else
557
862863033fdd updated for version 7.0158
vimboss
parents: 548
diff changeset
54 syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 " Use only the bare minimum of rules
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
59 if get(g:, 'perl_fold', 1)
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
60 syn region perlPOD start="^=[a-z]" end="^=cut" fold
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 else
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
62 syn region perlPOD start="^=[a-z]" end="^=cut"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
67 syn cluster perlTop contains=TOP
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
68
5277
42bf9264e64e Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5239
diff changeset
69 syn region perlBraces start="{" end="}" transparent extend
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
70
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " All keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 "
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
73 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
74 syn match perlConditional "\<else\%(\%(\_s\*if\>\)\|\>\)" contains=perlElseIfError skipwhite skipnl skipempty
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
75 syn match perlRepeat "\<\%(while\|for\%(each\)\=\|do\|until\|continue\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
76 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
77 " 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
78 " folding issues...
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
79 syn match perlFakeGroup "" contained
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
80 syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>\_s*" nextgroup=perlFakeGroup
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
82 syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
83 syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>"
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
84 syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|fc\|uc\%(first\)\=\)\>"
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
85 syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
86 syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
87 syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
88 syn match perlStatementHash "\<\%(delete\|each\|exists\|keys\|values\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
89 syn match perlStatementIOfunc "\<\%(syscall\|dbmopen\|dbmclose\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
90 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
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
91 syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read\|seek\%(dir\)\=\|sys\%(open\|read\|seek\|write\)\|truncate\)\>" nextgroup=perlFiledescStatementComma skipwhite
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
92 syn match perlStatementVector "\<vec\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
93 syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
94 syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
95 syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>"
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
96 syn match perlStatementInclude "\<\%(require\|import\|unimport\)\>"
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
97 syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autodie\%(::\%(exception\%(::system\)\=\|hints\|skip\)\)\=\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|deprecate\|diagnostics\|encoding\%(::warnings\)\=\|experimental\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|ok\|open\|ops\|overload\|overloading\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
98 syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
5239
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
99 syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>"
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
100 syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
101 syn match perlStatementNetwork "\<\%(\%(end\|[gs]et\)\%(host\|net\|proto\|serv\)ent\|get\%(\%(host\|net\)by\%(addr\|name\)\|protoby\%(name\|number\)\|servby\%(name\|port\)\)\)\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
102 syn match perlStatementPword "\<\%(get\%(pw\%(uid\|nam\)\|gr\%(gid\|nam\)\|login\)\)\|\%(end\|[gs]et\)\%(pw\|gr\)ent\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
103 syn match perlStatementTime "\<\%(gmtime\|localtime\|time\)\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
5239
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
105 syn match perlStatementMisc "\<\%(warn\|format\|formline\|reset\|scalar\|prototype\|lock\|tied\=\|untie\)\>"
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
106
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
107 syn keyword perlTodo TODO TODO: TBD TBD: FIXME FIXME: XXX XXX: NOTE NOTE: contained
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
108
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
109 syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\%(\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*\)\@<={" end="}" transparent extend
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
110
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
111 syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 " Perl Identifiers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 " Should be cleaned up to better handle identifiers in particular situations
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 " (in hash keys for example)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 " Plain identifiers: $foo, @foo, $#foo, %foo, &foo and dereferences $$foo, @$foo, etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 " We do not process complex things such as @{${"foo"}}. Too complicated, and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 " too slow. And what is after the -> is *not* considered as part of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 " variable - there again, too complicated and too slow.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 " Special variables first ($^A, ...) and ($|, $', ...)
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
124 syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\="
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
125 syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]"
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
126 syn match perlVarPlain "@[-+]"
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
127 syn match perlVarPlain "$\%(0\|[1-9]\d*\)"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 " Same as above, but avoids confusion in $::foo (equivalent to $main::foo)
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
129 syn match perlVarPlain "$::\@!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 " These variables are not recognized within matches.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 syn match perlVarNotInMatches "$[|)]"
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
132 " This variable is not recognized within matches delimited by m//.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 syn match perlVarSlash "$/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 " And plain identifiers
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
136 syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\=\%(::\|'\)\I"ms=s+1,me=e-1 contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
138 " To not highlight packages in variables as a scope reference - i.e. in
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
139 " $pack::var, pack:: is a scope, just set "perl_no_scope_in_variables"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
140 " If you don't want complex things like @{${"foo"}} to be processed,
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
141 " just set the variable "perl_no_extended_vars"...
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
142
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
143 if !get(g:, 'perl_no_scope_in_variables', 0)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
144 syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
145 syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
146 syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 else
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
148 syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
149 syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
150 syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
153 syn match perlVarPlain2 "%[-+]"
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
154
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
155 if !get(g:, 'perl_no_extended_vars', 0)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
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,perlQ,perlQQ,perlQW,perlQR,perlArrow,perlBraces
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
157 syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contained
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
158 syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contained
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
159 syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contained
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
160 syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contained
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
161 syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
162 syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
163 syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
164 syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
165 syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
166 syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref contains=perlVarSimpleMemberName contained extend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 syn match perlVarSimpleMemberName "\I\i*" contained
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
168 syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlPostDeref extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
169 syn match perlPackageConst "__PACKAGE__" nextgroup=perlPostDeref
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
170 syn match perlPostDeref "->\%($#\|[$@%&*]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlPostDeref
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
171 syn region perlPostDeref start="->\%($#\|[$@%&*]\)\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlPostDeref
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
172 syn region perlPostDeref matchgroup=perlPostDeref start="->\%($#\|[$@%&*]\){" skip="\\}" end="}" keepend extend contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlPostDeref
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 " File Descriptors
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
176 syn match perlFiledescRead "<\h\w*>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
178 syn match perlFiledescStatementComma "(\=\s*\<\u\w*\>\s*,"me=e-1 transparent contained contains=perlFiledescStatement
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
179 syn match perlFiledescStatementNocomma "(\=\s*\<\u\w*\>\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
181 syn match perlFiledescStatement "\<\u\w*\>" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 " Special characters in strings and matches
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
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
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
186 syn match perlSpecialStringU "\\\\" contained
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
187 syn match perlSpecialMatch "\\[1-9]" contained extend
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
188 syn match perlSpecialMatch "\\g\%(\d\+\|{\%(-\=\d\+\|\h\w*\)}\)" contained
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
189 syn match perlSpecialMatch "\\k\%(<\h\w*>\|'\h\w*'\)" contained
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 syn match perlSpecialMatch "[+*()?.]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 syn match perlSpecialMatch "(?[#:=!]" contained
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
194 syn match perlSpecialMatch "(?[impsx]*\%(-[imsx]\+\)\=)" contained
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
195 syn match perlSpecialMatch "(?\%([-+]\=\d\+\|R\))" contained
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
196 syn match perlSpecialMatch "(?\%(&\|P[>=]\)\h\w*)" contained
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
197 syn match perlSpecialMatch "(\*\%(\%(PRUNE\|SKIP\|THEN\)\%(:[^)]*\)\=\|\%(MARK\|\):[^)]*\|COMMIT\|F\%(AIL\)\=\|ACCEPT\))" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 " Possible errors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 " Highlight lines with only whitespace (only in blank delimited here documents) as errors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 " Variable interpolation
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 " These items are interpolated inside "" strings and similar constructs.
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
210 syn cluster perlInterpDQ contains=perlSpecialString,perlVarPlain,perlVarNotInMatches,perlVarSlash,perlVarBlock
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 " These items are interpolated inside '' strings and similar constructs.
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
212 syn cluster perlInterpSQ contains=perlSpecialStringU,perlSpecialStringU2
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 " These items are interpolated inside m// matches and s/// substitutions.
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
214 syn cluster perlInterpSlash contains=perlSpecialString,perlSpecialMatch,perlVarPlain,perlVarBlock
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 " These items are interpolated inside m## matches and s### substitutions.
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
216 syn cluster perlInterpMatch contains=@perlInterpSlash,perlVarSlash
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 " Shell commands
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
219 syn region perlShellCommand matchgroup=perlMatchStartEnd start="`" end="`" contains=@perlInterpDQ keepend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 " Constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 " Numbers
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
224 syn case ignore
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
225 syn match perlNumber "\<\%(0\|[1-9]\%(_\=\d\)*\)\>"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
226 syn match perlNumber "\<0\%(x\x\%(_\=\x\)*\|b[01]\%(_\=[01]\)*\|o\=\%(_\=\o\)*\)\>"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
227 syn match perlFloat "\<\d\%(_\=\d\)*e[-+]\=\d\%(_\=\d\)*"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
228 syn match perlFloat "\<\d\%(_\=\d\)*\.\%(\d\%(_\=\d\)*\)\=\%(e[-+]\=\d\%(_\=\d\)*\)\="
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
229 syn match perlFloat "\.\d\%(_\=\d\)*\%(e[-+]\=\d\%(_\=\d\)*\)\="
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
230 syn match perlFloat "\<0x\x\%(_\=\x\)*p[-+]\=\d\%(_\=\d\)*"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
231 syn match perlFloat "\<0x\x\%(_\=\x\)*\.\%(\x\%(_\=\x\)*\)\=\%(p[-+]\=\d\%(_\=\d\)*\)\="
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
232 syn match perlFloat "\<0x\.\x\%(_\=\x\)*\%(p[-+]\=\d\%(_\=\d\)*\)\="
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
233 syn case match
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
234
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
235 syn match perlString "\<\%(v\d\+\%(\.\d\+\)*\|\d\+\%(\.\d\+\)\{2,}\)\>" contains=perlVStringV
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
236 syn match perlVStringV "\<v" contained
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
237
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
238
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
239 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
240 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
241 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
242 syn region perlAnglesSQ start=+<+ end=+>+ extend contained contains=perlAnglesSQ,@perlInterpSQ keepend
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
243
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
244 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
245 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
246 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
247 syn region perlAnglesDQ start=+<+ end=+>+ extend contained contains=perlAnglesDQ,@perlInterpDQ keepend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 " Simple version of searches and matches
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
251 syn match perlMatchModifiers "[msixpadluncgo]\+" contained
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
252 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1+ contains=@perlInterpMatch keepend extend nextgroup=perlMatchModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
253 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#+ contains=@perlInterpMatch keepend extend nextgroup=perlMatchModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
254 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'+ contains=@perlInterpSQ keepend extend nextgroup=perlMatchModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
255 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/+ contains=@perlInterpSlash keepend extend nextgroup=perlMatchModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
256 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)+ contains=@perlInterpMatch,perlParensDQ keepend extend nextgroup=perlMatchModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
257 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ extend nextgroup=perlMatchModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
258 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ keepend extend nextgroup=perlMatchModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
259 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ keepend extend nextgroup=perlMatchModifiers
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 " Below some hacks to recognise the // variant. This is virtually impossible to catch in all
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 " cases as the / is used in so many other ways, but these should be the most obvious ones.
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
263 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=+/+ contains=@perlInterpSlash extend nextgroup=perlMatchModifiers
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 " Substitutions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 " perlMatch is the first part, perlSubstitution* is the substitution part
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
268 syn match perlSubstitutionModifiers "[msixpadluncgero]\+" contained
5239
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
269 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend extend
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
270 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*'+ end=+'+me=e-1 contains=@perlInterpSQ nextgroup=perlSubstitutionSQ keepend extend
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
271 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*/+ end=+/+me=e-1 contains=@perlInterpSlash nextgroup=perlSubstitutionGQQ keepend extend
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
272 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s#+ end=+#+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend extend
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
273 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*(+ end=+)+ contains=@perlInterpMatch,perlParensDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
274 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
11cd8d58372e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
275 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
276 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
277 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1+ keepend contained contains=@perlInterpDQ extend nextgroup=perlSubstitutionModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
278 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)+ contained contains=@perlInterpDQ,perlParensDQ keepend extend nextgroup=perlSubstitutionModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
279 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\]+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend nextgroup=perlSubstitutionModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
280 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend nextgroup=perlSubstitutionModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
281 syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend nextgroup=perlSubstitutionModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
282 syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'+ contained contains=@perlInterpSQ keepend extend nextgroup=perlSubstitutionModifiers
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
284 " Translations
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 " perlMatch is the first part, perlTranslation* is the second, translator part.
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
286 syn match perlTranslationModifiers "[cdsr]\+" contained
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
287 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\>\s*\z([^[:space:]([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
288 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)#+ end=+#+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
289 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
290 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
291 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
292 syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
293 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]([{<]\)+ end=+\z1+ contained nextgroup=perlTranslationModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
294 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+(+ end=+)+ contains=perlParensSQ contained nextgroup=perlTranslationModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
295 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\[+ end=+\]+ contains=perlBracketsSQ contained nextgroup=perlTranslationModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
296 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+{+ end=+}+ contains=perlBracesSQ contained nextgroup=perlTranslationModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
297 syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+<+ end=+>+ contains=perlAnglesSQ contained nextgroup=perlTranslationModifiers
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 " Strings and q, qq, qw and qr expressions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
302 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
303 syn region perlString matchgroup=perlStringStartEnd start=+"+ end=+"+ contains=@perlInterpDQ keepend extend
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
304 syn region perlQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\>\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
305 syn region perlQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q#+ end=+#+ contains=@perlInterpSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
306 syn region perlQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
307 syn region perlQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
308 syn region perlQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
309 syn region perlQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend extend
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
310
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
311 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
312 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
313 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
314 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
315 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
316 syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*<+ end=+>+ contains=@perlInterpDQ,perlAnglesDQ keepend extend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
318 syn region perlQW matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
319 syn region perlQW matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw#+ end=+#+ contains=@perlInterpSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
320 syn region perlQW matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
321 syn region perlQW matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
322 syn region perlQW matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
323 syn region perlQW matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend extend
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
324
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
325 syn match perlQRModifiers "[msixpadluno]\+" contained
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
326 syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1+ contains=@perlInterpMatch keepend extend nextgroup=perlQRModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
327 syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/+ contains=@perlInterpSlash keepend extend nextgroup=perlQRModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
328 syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#+ contains=@perlInterpMatch keepend extend nextgroup=perlQRModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
329 syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'+ contains=@perlInterpSQ keepend extend nextgroup=perlQRModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
330 syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)+ contains=@perlInterpMatch,perlParensDQ keepend extend nextgroup=perlQRModifiers
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
331
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
332 " A special case for qr{}, qr<> and qr[] which allows for comments and extra whitespace in the pattern
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
333 syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend nextgroup=perlQRModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
334 syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend nextgroup=perlQRModifiers
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
335 syn region perlQR matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend nextgroup=perlQRModifiers
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 " Constructs such as print <<EOF [...] EOF, 'here' documents
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 "
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
339 " XXX Any statements after the identifier are in perlString colour (i.e.
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
340 " 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
341 " seems due to the 'auto-extending nature' of regions.
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
342 " XXX Indented heredocs are not perfect - they sometimes seem to take a moment
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
343 " to update if switched from double to single quotes and vice versa.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
344 "
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
345 " Note: bare delimiters such as << to mean <<"" are not supported. These are a
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
346 " fatal error since 5.28 and, apparently, a rarely used feature.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
347
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
348 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\~\=\I\i*+ end=+$+ contains=@perlTop oneline
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
349 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\~\=\\\I\i*+ end=+$+ contains=@perlTop oneline
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
350 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\~\=\s*"[^\\"]*\%(\\.[^\\"]*\)*"+ end=+$+ contains=@perlTop oneline
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
351 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\~\=\s*'[^\\']*\%(\\.[^\\']*\)*'+ end=+$+ contains=@perlTop oneline
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
352 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\~\=\s*`[^\\`]*\%(\\.[^\\`]*\)*`+ end=+$+ contains=@perlTop oneline
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
353 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\~\=\s*""+ end=+$+ contains=@perlTop oneline
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
354 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\~\=\s*''+ end=+$+ contains=@perlTop oneline
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
355 syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\~\=\s*``+ end=+$+ contains=@perlTop oneline
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
356
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
357 if get(g:, 'perl_fold', 0)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
358 syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
359 syn region perlHereDoc start=+<<\\\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
360 syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
361 syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
362 syn region perlHereDoc start=+<<\s*`\z([^\\`]*\%(\\.[^\\`]*\)*\)`+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
363 syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
364 syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
365 syn region perlHereDoc start=+<<\s*``+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 else
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
367 syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
368 syn region perlHereDoc start=+<<\\\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
369 syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
370 syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
371 syn region perlHereDoc start=+<<\s*`\z([^\\`]*\%(\\.[^\\`]*\)*\)`+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
372 syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
373 syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
374 syn region perlHereDoc start=+<<\s*``+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
375 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
376
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
377 if get(g:, 'perl_fold', 0)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
378 syn region perlIndentedHereDoc start=+<<\~\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlIndentedHereDocStart,@perlInterpDQ fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
379 syn region perlIndentedHereDoc start=+<<\~\\\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlIndentedHereDocStart,@perlInterpSQ fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
380 syn region perlIndentedHereDoc start=+<<\~\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlIndentedHereDocStart,@perlInterpDQ fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
381 syn region perlIndentedHereDoc start=+<<\~\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlIndentedHereDocStart,@perlInterpSQ fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
382 syn region perlIndentedHereDoc start=+<<\~\s*`\z([^\\`]*\%(\\.[^\\`]*\)*\)`+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlIndentedHereDocStart,@perlInterpDQ fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
383 syn region perlIndentedHereDoc start=+<<\~\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlIndentedHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
384 syn region perlIndentedHereDoc start=+<<\~\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlIndentedHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
385 syn region perlIndentedHereDoc start=+<<\~\s*``+ matchgroup=perlStringStartEnd end=+^$+ contains=perlIndentedHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
386 else
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
387 syn region perlIndentedHereDoc start=+<<\~\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlHereDocStart,@perlInterpDQ
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
388 syn region perlIndentedHereDoc start=+<<\~\\\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlHereDocStart,@perlInterpSQ
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
389 syn region perlIndentedHereDoc start=+<<\~\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlHereDocStart,@perlInterpDQ
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
390 syn region perlIndentedHereDoc start=+<<\~\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlHereDocStart,@perlInterpSQ
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
391 syn region perlIndentedHereDoc start=+<<\~\s*`\z([^\\`]*\%(\\.[^\\`]*\)*\)`+ matchgroup=perlStringStartEnd end=+^\s*\z1$+ contains=perlHereDocStart,@perlInterpDQ
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
392 syn region perlIndentedHereDoc start=+<<\~\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
393 syn region perlIndentedHereDoc start=+<<\~\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
394 syn region perlIndentedHereDoc start=+<<\~\s*``+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 " Class declarations
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 "
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
400 syn match perlPackageDecl "\<package\s\+\%(\h\|::\)\%(\w\|::\)*" contains=perlStatementPackage
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 syn keyword perlStatementPackage package contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 " Functions
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
404 if get(g:, "perl_sub_signatures", 0)
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
405 syn match perlSubSignature "\s*([^)]*)" contained extend
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
406 else
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
407 syn match perlSubPrototype "\s*([\\$@%&*\[\];]*)" contained extend
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
408 endif
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
409 syn match perlSubAttribute "\s*:\s*\h\w*\%(([^)]*)\|\)" contained extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
410 syn match perlSubName "\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\s*" contained extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
411 syn region perlSubDeclaration start="" end="[;{]" contains=perlSubName,perlSubPrototype,perlSubAttribute,perlSubSignature,perlComment contained transparent
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
412 syn match perlFunction "\<sub\>\_s*" nextgroup=perlSubDeclaration
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
413
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
414 " The => operator forces a bareword to the left of it to be interpreted as
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
415 " a string
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
416 syn match perlString "\I\@<!-\?\I\i*\%(\s*=>\)\@="
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
417
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 " All other # are comments, except ^#!
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
419 syn match perlComment "#.*" contains=perlTodo,@Spell extend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 syn match perlSharpBang "^#!.*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 " Formats
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
423 syn region perlFormat matchgroup=perlStatementIOFunc start="^\s*\<format\s\+\k\+\s*=\s*$"rs=s+6 end="^\s*\.\s*$" contains=perlFormatName,perlFormatField,perlVarPlain,perlVarPlain2
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 syn match perlFormatName "format\s\+\k\+\s*="lc=7,me=e-1 contained
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
425 syn match perlFormatField "[@^][|<>~]\+\%(\.\.\.\)\=" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 syn match perlFormatField "[@^]#[#.]*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 syn match perlFormatField "@\*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 syn match perlFormatField "@[^A-Za-z_|<>~#*]"me=e-1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 syn match perlFormatField "@$" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 " __END__ and __DATA__ clauses
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
432
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
433 " Vim excludes empty syn-region end lines from the fold region. This is
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
434 " probably a bug and means a DATA section ending with an empty line does not
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
435 " have that final line included in the fold.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
436 "
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
437 " As a workaround we exploit an unterminated syntax region here with an end
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
438 " pattern that will (probably) never match. This forces all lines to be
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
439 " included in the fold region. Of course, if it does match then there's
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
440 " nothing to work around as it is a non-empty line.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
441 "
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
442 " This problem also exists with empty string delimited heredocs but there's no
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
443 " known workaround for that case.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
444 if get(g:, 'perl_fold', 0)
29193
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
445 syntax region perlDATA matchgroup=perlDATAStart start="^__DATA__$" end="VIM_PERL_EOF\%$" contains=@perlDATA fold
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
446 syntax region perlEND matchgroup=perlENDStart start="^__END__$" end="VIM_PERL_EOF\%$" contains=@perlDATA fold
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 else
29193
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
448 syntax region perlDATA matchgroup=perlDATAStart start="^__DATA__$" end="\%$" contains=@perlDATA
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
449 syntax region perlEND matchgroup=perlENDStart start="^__END__$" end="\%$" contains=@perlDATA
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
450 endif
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
451
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
452 " TODO: generalise this to allow other filetypes
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
453 if get(g:, 'perl_highlight_data', 0)
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
454 syn cluster perlDATA add=perlPOD
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
455 else
1e9e9d89f0ee Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29150
diff changeset
456 syn cluster perlDATA remove=perlPOD
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458
2548
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
459 "
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
460 " Folding
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
461 if get(g:, 'perl_fold', 0)
2548
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
462 " 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
463 " keyword, otherwise this will screw up Pod lines that match /^package/
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
464 if !get(g:, 'perl_nofold_packages', 0)
2548
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
465 syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
466 syn region perlPackageFold start="^\z(\s*\)package\s*\S\+\s*{" end="^\z1}" transparent fold keepend
2548
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
467 endif
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
468 if !get(g:, 'perl_nofold_subs', 0)
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
469 if get(g:, "perl_fold_anonymous_subs", 0)
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
470 " EXPLANATION:
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
471 " \<sub\> - "sub" keyword
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
472 " \_[^;{]* - any characters, including new line, but not ";" or "{", zero or more times
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
473 " \%(([\\$@%&*\[\];]*)\)\= - prototype definition, \$@%&*[]; characters between (), zero or 1 times
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
474 " \_[^;]* - any characters, including new line, but not ";" or "{", zero or more times
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
475 " { - start subroutine block
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
476 syn region perlSubFold start="\<sub\>\_[^;{]*\%(([\\$@%&*\[\];]*)\)\=\_[^;{]*{" end="}" transparent fold keepend extend
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
477 else
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
478 " EXPLANATION:
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
479 " same, as above, but first non-space character after "sub" keyword must
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
480 " be [A-Za-z_]
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
481 syn region perlSubFold start="\<sub\>\s*\h\_[^;{]*\%(([\\$@%&*\[\];]*)\)\=\_[^;]*{" end="}" transparent fold keepend extend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
482 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
483
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
484 syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>\_s*{" end="}" transparent fold keepend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
485 endif
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
486
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
487 if get(g:, 'perl_fold_blocks', 0)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
488 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
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
489
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
490 " TODO this is works incorrectly
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
491 syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
492 else
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
493 if get(g:, 'perl_fold_do_blocks', 0)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
494 syn region perlDoBlockDeclaration start="" end="{" contains=perlComment contained transparent
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
495 syn match perlOperator "\<do\>\_s*" nextgroup=perlDoBlockDeclaration
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
496
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
497 syn region perlDoBlockFold start="\<do\>\_[^{]*{" end="}" transparent fold keepend extend
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
498 endif
2548
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
499 endif
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
500
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
501 syn sync fromstart
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
502 else
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
503 " 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
504 syn sync minlines=0
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
505 endif
0bb74f626ba7 Update to Perl runtime files. (Andy Lester)
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
506
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
507 " 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
508 " them into b:match_skip in ftplugin/perl.vim.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
509
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
510 " The default highlighting.
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
511 hi def link perlSharpBang PreProc
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
512 hi def link perlControl PreProc
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
513 hi def link perlInclude Include
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
514 hi def link perlSpecial Special
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
515 hi def link perlString String
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
516 hi def link perlCharacter Character
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
517 hi def link perlNumber Number
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
518 hi def link perlFloat Float
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
519 hi def link perlType Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
520 hi def link perlIdentifier Identifier
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
521 hi def link perlLabel Label
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
522 hi def link perlStatement Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
523 hi def link perlConditional Conditional
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
524 hi def link perlRepeat Repeat
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
525 hi def link perlOperator Operator
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
526 hi def link perlFunction Keyword
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
527 hi def link perlSubName Function
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
528 hi def link perlSubPrototype Type
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
529 hi def link perlSubSignature Type
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
530 hi def link perlSubAttribute PreProc
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
531 hi def link perlComment Comment
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
532 hi def link perlTodo Todo
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
533 if get(g:, 'perl_string_as_statement', 0)
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
534 hi def link perlStringStartEnd perlStatement
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
535 else
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
536 hi def link perlStringStartEnd perlString
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
537 endif
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
538 hi def link perlVStringV perlStringStartEnd
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
539 hi def link perlList perlStatement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
540 hi def link perlMisc perlStatement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
541 hi def link perlVarPlain perlIdentifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
542 hi def link perlVarPlain2 perlIdentifier
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
543 hi def link perlArrow perlIdentifier
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
544 hi def link perlFiledescRead perlIdentifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
545 hi def link perlFiledescStatement perlIdentifier
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
546 hi def link perlVarSimpleMember perlIdentifier
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
547 hi def link perlVarSimpleMemberName perlString
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
548 hi def link perlVarNotInMatches perlIdentifier
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
549 hi def link perlVarSlash perlIdentifier
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
550 hi def link perlQ perlString
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
551 hi def link perlQQ perlString
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
552 hi def link perlQW perlString
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
553 hi def link perlQR perlString
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
554 hi def link perlMatchModifiers perlMatchStartEnd
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
555 hi def link perlSubstitutionModifiers perlMatchStartEnd
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
556 hi def link perlTranslationModifiers perlMatchStartEnd
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
557 hi def link perlQRModifiers perlStringStartEnd
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
558 hi def link perlHereDoc perlString
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
559 hi def link perlIndentedHereDoc perlString
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
560 hi def link perlStringUnexpanded perlString
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
561 hi def link perlSubstitutionSQ perlString
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
562 hi def link perlSubstitutionGQQ perlString
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
563 hi def link perlTranslationGQ perlString
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
564 hi def link perlMatch perlString
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
565 hi def link perlMatchStartEnd perlStatement
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
566 hi def link perlFormatName perlIdentifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
567 hi def link perlFormatField perlString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
568 hi def link perlPackageDecl perlType
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
569 hi def link perlStorageClass perlType
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
570 hi def link perlPackageRef perlType
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
571 hi def link perlStatementPackage perlStatement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
572 hi def link perlStatementStorage perlStatement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
573 hi def link perlStatementControl perlStatement
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
574 hi def link perlStatementScalar perlStatement
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
575 hi def link perlStatementRegexp perlStatement
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
576 hi def link perlStatementNumeric perlStatement
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
577 hi def link perlStatementList perlStatement
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
578 hi def link perlStatementHash perlStatement
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
579 hi def link perlStatementIOfunc perlStatement
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
580 hi def link perlStatementFiledesc perlStatement
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
581 hi def link perlStatementVector perlStatement
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
582 hi def link perlStatementFiles perlStatement
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
583 hi def link perlStatementFlow perlStatement
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
584 hi def link perlStatementInclude perlStatement
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
585 hi def link perlStatementProc perlStatement
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
586 hi def link perlStatementSocket perlStatement
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
587 hi def link perlStatementIPC perlStatement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
588 hi def link perlStatementNetwork perlStatement
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
589 hi def link perlStatementPword perlStatement
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
590 hi def link perlStatementTime perlStatement
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
591 hi def link perlStatementMisc perlStatement
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
592 hi def link perlStatementIndirObj perlStatement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
593 hi def link perlFunctionName perlIdentifier
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
594 hi def link perlMethod perlIdentifier
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
595 hi def link perlPostDeref perlIdentifier
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
596 hi def link perlFunctionPRef perlType
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
597
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
598 if !get(g:, 'perl_include_pod', 1)
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
599 hi def link perlPOD perlComment
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
600 endif
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
601 hi def link perlShellCommand perlString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
602 hi def link perlSpecialAscii perlSpecial
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
603 hi def link perlSpecialDollar perlSpecial
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
604 hi def link perlSpecialString perlSpecial
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
605 hi def link perlSpecialStringU perlSpecial
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
606 hi def link perlSpecialMatch perlSpecial
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
607 hi def link perlEND perlComment
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
608 hi def link perlENDStart perlEND
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
609 hi def link perlDATA perlComment
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
610 hi def link perlDATAStart perlDATA
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
611
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
612 " NOTE: Due to a bug in Vim (or more likely, a misunderstanding on my part),
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
613 " I had to remove the transparent property from the following regions
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
614 " in order to get them to highlight correctly. Feel free to remove
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
615 " 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
616 hi def link perlParensSQ perlString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
617 hi def link perlBracketsSQ perlString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
618 hi def link perlBracesSQ perlString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
619 hi def link perlAnglesSQ perlString
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
620
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
621 hi def link perlParensDQ perlString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
622 hi def link perlBracketsDQ perlString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
623 hi def link perlBracesDQ perlString
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
624 hi def link perlAnglesDQ perlString
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
625
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
626 hi def link perlSpecialStringU2 perlString
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
627
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
628 " Possible errors
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
629 hi def link perlNotEmptyLine Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
630 hi def link perlElseIfError Error
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 557
diff changeset
631
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 " Syncing to speed up processing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633 "
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
634 if !get(g:, 'perl_no_sync_on_sub', 0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 syn sync match perlSync grouphere NONE "^\s*\<package\s"
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
636 syn sync match perlSync grouphere NONE "^\s*\<sub\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 syn sync match perlSync grouphere NONE "^}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
640 if !get(g:, 'perl_no_sync_on_global_var', 0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 syn sync match perlSync grouphere NONE "^$\I[[:alnum:]_:]+\s*=\s*{"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 syn sync match perlSync grouphere NONE "^[@%]\I[[:alnum:]_:]+\s*=\s*("
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
645 if get(g:, 'perl_sync_dist', 0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 execute "syn sync maxlines=" . perl_sync_dist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648 syn sync maxlines=100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 syn sync match perlSyncPOD grouphere perlPOD "^=pod"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 syn sync match perlSyncPOD grouphere perlPOD "^=head"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653 syn sync match perlSyncPOD grouphere perlPOD "^=item"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 syn sync match perlSyncPOD grouphere NONE "^=cut"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 let b:current_syntax = "perl"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
658 let &cpo = s:cpo_save
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
659 unlet s:cpo_save
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2548
diff changeset
660
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
661 " XXX Change to sts=4:sw=4
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1118
diff changeset
662 " vim:ts=8:sts=2:sw=2:expandtab:ft=vim