summaryrefslogtreecommitdiffstats
path: root/syntax/perl.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2015-05-11 15:05:13 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2015-05-11 15:05:13 +0200
commit271b63d71707720ad0d35590b8cb50f8f8f43014 (patch)
tree1b71daa457afc68465f66ee2afc9a00c1380f23d /syntax/perl.vim
parentacd7ce59503b22ac7663fc25776efe25e266f1d4 (diff)
downloadvim-polyglot-271b63d71707720ad0d35590b8cb50f8f8f43014.tar.gz
vim-polyglot-271b63d71707720ad0d35590b8cb50f8f8f43014.zip
Updatev1.13.2
Diffstat (limited to 'syntax/perl.vim')
-rw-r--r--syntax/perl.vim12
1 files changed, 6 insertions, 6 deletions
diff --git a/syntax/perl.vim b/syntax/perl.vim
index 6fdebdd3..cffca6d6 100644
--- a/syntax/perl.vim
+++ b/syntax/perl.vim
@@ -365,11 +365,11 @@ syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*("
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
syn match perlSubAttributes "" contained nextgroup=perlSubError
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
-if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9
+if get(g:, "perl_sub_signatures", 0)
+ syn match perlSignature +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained
+else
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
-else
- syntax match perlSignature "(.\{-})" nextgroup=perlSubAttributes,perlComment contained
endif
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment
@@ -412,9 +412,9 @@ if exists("perl_fold")
syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
endif
if !exists("perl_nofold_subs")
- if exists("perl_fold_anonymous_subs") && perl_fold_anonymous_subs
- syn region perlSubFold start="\<sub\>[^;]*{" end="}" transparent fold keepend extend
- syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
+ if get(g:, "perl_fold_anonymous_subs", 0)
+ syn region perlSubFold start="\<sub\>[^{]*{" end="}" transparent fold keepend extend
+ syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
else
syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend