summaryrefslogtreecommitdiffstats
path: root/syntax/perl.vim
diff options
context:
space:
mode:
Diffstat (limited to 'syntax/perl.vim')
-rw-r--r--syntax/perl.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/syntax/perl.vim b/syntax/perl.vim
index 61c7dd9b..4b1c89b8 100644
--- a/syntax/perl.vim
+++ b/syntax/perl.vim
@@ -365,8 +365,10 @@ else
syn match perlSubAttributes "" contained nextgroup=perlSubError
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
endif
-syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
-syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
+if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9
+ syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
+ syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
+endif
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlComment
syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName