From 956b98d98ea53f6859edeea5e06f50a1b3474e89 Mon Sep 17 00:00:00 2001 From: Rob Hoelz Date: Tue, 12 Sep 2017 22:32:18 -0500 Subject: [PATCH] Integrate upstream changes Removal of version checks and removal of HiLink workaround --- syntax/mason.vim | 46 +++-------- syntax/perl.vim | 198 +++++++++++++++++++++++------------------------ syntax/pod.vim | 40 ++++------ syntax/xs.vim | 46 +++-------- 4 files changed, 132 insertions(+), 198 deletions(-) diff --git a/syntax/mason.vim b/syntax/mason.vim index b4c03ae2..25349a4a 100644 --- a/syntax/mason.vim +++ b/syntax/mason.vim @@ -11,12 +11,8 @@ " - Fix <%text> blocks to show HTML tags but ignore Mason tags. " -" Clear previous syntax settings unless this is v6 or above, in which case just -" exit without doing anything. -" -if version < 600 - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -28,26 +24,16 @@ endif " First pull in the HTML syntax. " -if version < 600 - so :p:h/html.vim -else - runtime! syntax/html.vim - unlet b:current_syntax -endif +runtime! syntax/html.vim +unlet b:current_syntax syn cluster htmlPreproc add=@masonTop " Now pull in the Perl syntax. " -if version < 600 - syn include @perlTop :p:h/perl.vim - unlet b:current_syntax - syn include @podTop :p:h/pod.vim -else - syn include @perlTop syntax/perl.vim - unlet b:current_syntax - syn include @podTop syntax/pod.vim -endif +syn include @perlTop syntax/perl.vim +unlet b:current_syntax +syn include @podTop syntax/pod.vim " It's hard to reduce down to the correct sub-set of Perl to highlight in some " of these cases so I've taken the safe option of just using perlTop in all of @@ -86,21 +72,9 @@ syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs, " Set up default highlighting. Almost all of this is done in the included " syntax files. -" -if version >= 508 || !exists("did_mason_syn_inits") - if version < 508 - let did_mason_syn_inits = 1 - com -nargs=+ HiLink hi link - else - com -nargs=+ HiLink hi def link - endif - - HiLink masonDoc Comment - HiLink masonPod Comment - HiLink masonPerlComment perlComment - - delc HiLink -endif +hi def link masonDoc Comment +hi def link masonPod Comment +hi def link masonPerlComment perlComment let b:current_syntax = "mason" diff --git a/syntax/perl.vim b/syntax/perl.vim index c12803f1..1769d195 100644 --- a/syntax/perl.vim +++ b/syntax/perl.vim @@ -433,125 +433,121 @@ else syn sync minlines=0 endif -command -nargs=+ HiLink hi def link - " NOTE: If you're linking new highlight groups to perlString, please also put " them into b:match_skip in ftplugin/perl.vim. " The default highlighting. -HiLink perlSharpBang PreProc -HiLink perlControl PreProc -HiLink perlInclude Include -HiLink perlSpecial Special -HiLink perlString String -HiLink perlCharacter Character -HiLink perlNumber Number -HiLink perlFloat Float -HiLink perlType Type -HiLink perlIdentifier Identifier -HiLink perlLabel Label -HiLink perlStatement Statement -HiLink perlConditional Conditional -HiLink perlRepeat Repeat -HiLink perlOperator Operator -HiLink perlFunction Keyword -HiLink perlSubName Function -HiLink perlSubPrototype Type -HiLink perlSignature Type -HiLink perlSubAttributes PreProc -HiLink perlSubAttributesCont perlSubAttributes -HiLink perlComment Comment -HiLink perlTodo Todo +hi def link perlSharpBang PreProc +hi def link perlControl PreProc +hi def link perlInclude Include +hi def link perlSpecial Special +hi def link perlString String +hi def link perlCharacter Character +hi def link perlNumber Number +hi def link perlFloat Float +hi def link perlType Type +hi def link perlIdentifier Identifier +hi def link perlLabel Label +hi def link perlStatement Statement +hi def link perlConditional Conditional +hi def link perlRepeat Repeat +hi def link perlOperator Operator +hi def link perlFunction Keyword +hi def link perlSubName Function +hi def link perlSubPrototype Type +hi def link perlSignature Type +hi def link perlSubAttributes PreProc +hi def link perlSubAttributesCont perlSubAttributes +hi def link perlComment Comment +hi def link perlTodo Todo if exists("perl_string_as_statement") - HiLink perlStringStartEnd perlStatement + hi def link perlStringStartEnd perlStatement else - HiLink perlStringStartEnd perlString + hi def link perlStringStartEnd perlString endif -HiLink perlVStringV perlStringStartEnd -HiLink perlList perlStatement -HiLink perlMisc perlStatement -HiLink perlVarPlain perlIdentifier -HiLink perlVarPlain2 perlIdentifier -HiLink perlArrow perlIdentifier -HiLink perlFiledescRead perlIdentifier -HiLink perlFiledescStatement perlIdentifier -HiLink perlVarSimpleMember perlIdentifier -HiLink perlVarSimpleMemberName perlString -HiLink perlVarNotInMatches perlIdentifier -HiLink perlVarSlash perlIdentifier -HiLink perlQQ perlString -HiLink perlHereDoc perlString -HiLink perlStringUnexpanded perlString -HiLink perlSubstitutionSQ perlString -HiLink perlSubstitutionGQQ perlString -HiLink perlTranslationGQ perlString -HiLink perlMatch perlString -HiLink perlMatchStartEnd perlStatement -HiLink perlFormatName perlIdentifier -HiLink perlFormatField perlString -HiLink perlPackageDecl perlType -HiLink perlStorageClass perlType -HiLink perlPackageRef perlType -HiLink perlStatementPackage perlStatement -HiLink perlStatementStorage perlStatement -HiLink perlStatementControl perlStatement -HiLink perlStatementScalar perlStatement -HiLink perlStatementRegexp perlStatement -HiLink perlStatementNumeric perlStatement -HiLink perlStatementList perlStatement -HiLink perlStatementHash perlStatement -HiLink perlStatementIOfunc perlStatement -HiLink perlStatementFiledesc perlStatement -HiLink perlStatementVector perlStatement -HiLink perlStatementFiles perlStatement -HiLink perlStatementFlow perlStatement -HiLink perlStatementInclude perlStatement -HiLink perlStatementProc perlStatement -HiLink perlStatementSocket perlStatement -HiLink perlStatementIPC perlStatement -HiLink perlStatementNetwork perlStatement -HiLink perlStatementPword perlStatement -HiLink perlStatementTime perlStatement -HiLink perlStatementMisc perlStatement -HiLink perlStatementIndirObj perlStatement -HiLink perlFunctionName perlIdentifier -HiLink perlMethod perlIdentifier -HiLink perlPostDeref perlIdentifier -HiLink perlFunctionPRef perlType +hi def link perlVStringV perlStringStartEnd +hi def link perlList perlStatement +hi def link perlMisc perlStatement +hi def link perlVarPlain perlIdentifier +hi def link perlVarPlain2 perlIdentifier +hi def link perlArrow perlIdentifier +hi def link perlFiledescRead perlIdentifier +hi def link perlFiledescStatement perlIdentifier +hi def link perlVarSimpleMember perlIdentifier +hi def link perlVarSimpleMemberName perlString +hi def link perlVarNotInMatches perlIdentifier +hi def link perlVarSlash perlIdentifier +hi def link perlQQ perlString +hi def link perlHereDoc perlString +hi def link perlStringUnexpanded perlString +hi def link perlSubstitutionSQ perlString +hi def link perlSubstitutionGQQ perlString +hi def link perlTranslationGQ perlString +hi def link perlMatch perlString +hi def link perlMatchStartEnd perlStatement +hi def link perlFormatName perlIdentifier +hi def link perlFormatField perlString +hi def link perlPackageDecl perlType +hi def link perlStorageClass perlType +hi def link perlPackageRef perlType +hi def link perlStatementPackage perlStatement +hi def link perlStatementStorage perlStatement +hi def link perlStatementControl perlStatement +hi def link perlStatementScalar perlStatement +hi def link perlStatementRegexp perlStatement +hi def link perlStatementNumeric perlStatement +hi def link perlStatementList perlStatement +hi def link perlStatementHash perlStatement +hi def link perlStatementIOfunc perlStatement +hi def link perlStatementFiledesc perlStatement +hi def link perlStatementVector perlStatement +hi def link perlStatementFiles perlStatement +hi def link perlStatementFlow perlStatement +hi def link perlStatementInclude perlStatement +hi def link perlStatementProc perlStatement +hi def link perlStatementSocket perlStatement +hi def link perlStatementIPC perlStatement +hi def link perlStatementNetwork perlStatement +hi def link perlStatementPword perlStatement +hi def link perlStatementTime perlStatement +hi def link perlStatementMisc perlStatement +hi def link perlStatementIndirObj perlStatement +hi def link perlFunctionName perlIdentifier +hi def link perlMethod perlIdentifier +hi def link perlPostDeref perlIdentifier +hi def link perlFunctionPRef perlType if !get(g:, 'perl_include_pod', 1) - HiLink perlPOD perlComment + hi def link perlPOD perlComment endif -HiLink perlShellCommand perlString -HiLink perlSpecialAscii perlSpecial -HiLink perlSpecialDollar perlSpecial -HiLink perlSpecialString perlSpecial -HiLink perlSpecialStringU perlSpecial -HiLink perlSpecialMatch perlSpecial -HiLink perlDATA perlComment +hi def link perlShellCommand perlString +hi def link perlSpecialAscii perlSpecial +hi def link perlSpecialDollar perlSpecial +hi def link perlSpecialString perlSpecial +hi def link perlSpecialStringU perlSpecial +hi def link perlSpecialMatch perlSpecial +hi def link perlDATA perlComment " NOTE: Due to a bug in Vim (or more likely, a misunderstanding on my part), " I had to remove the transparent property from the following regions " in order to get them to highlight correctly. Feel free to remove " these and reinstate the transparent property if you know how. -HiLink perlParensSQ perlString -HiLink perlBracketsSQ perlString -HiLink perlBracesSQ perlString -HiLink perlAnglesSQ perlString +hi def link perlParensSQ perlString +hi def link perlBracketsSQ perlString +hi def link perlBracesSQ perlString +hi def link perlAnglesSQ perlString -HiLink perlParensDQ perlString -HiLink perlBracketsDQ perlString -HiLink perlBracesDQ perlString -HiLink perlAnglesDQ perlString +hi def link perlParensDQ perlString +hi def link perlBracketsDQ perlString +hi def link perlBracesDQ perlString +hi def link perlAnglesDQ perlString -HiLink perlSpecialStringU2 perlString +hi def link perlSpecialStringU2 perlString " Possible errors -HiLink perlNotEmptyLine Error -HiLink perlElseIfError Error -HiLink perlSubPrototypeError Error -HiLink perlSubError Error - -delcommand HiLink +hi def link perlNotEmptyLine Error +hi def link perlElseIfError Error +hi def link perlSubPrototypeError Error +hi def link perlSubError Error " Syncing to speed up processing " diff --git a/syntax/pod.vim b/syntax/pod.vim index 094eff7d..b984f117 100644 --- a/syntax/pod.vim +++ b/syntax/pod.vim @@ -19,11 +19,8 @@ " Remove any old syntax stuff hanging around (this is suppressed " automatically by ":syn include" if necessary). -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -67,28 +64,17 @@ syn match podEscape "\I\i*>"me=e-1 contained contains=@NoSpell syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_pod_syntax_inits") - if version < 508 - let did_pod_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink podCommand Statement - HiLink podCmdText String - HiLink podOverIndent Number - HiLink podForKeywd Identifier - HiLink podFormat Identifier - HiLink podVerbatimLine PreProc - HiLink podSpecial Identifier - HiLink podEscape String - HiLink podEscape2 Number - - delcommand HiLink -endif +" Only when an item doesn't have highlighting yet + +hi def link podCommand Statement +hi def link podCmdText String +hi def link podOverIndent Number +hi def link podForKeywd Identifier +hi def link podFormat Identifier +hi def link podVerbatimLine PreProc +hi def link podSpecial Identifier +hi def link podEscape String +hi def link podEscape2 Number if exists("perl_pod_spellcheck_headings") " Spell-check headings diff --git a/syntax/xs.vim b/syntax/xs.vim index a75bd34d..4f79c443 100644 --- a/syntax/xs.vim +++ b/syntax/xs.vim @@ -5,20 +5,11 @@ " Previous: Vincent Pit " Last Change: 2016-02-01 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +if exists("b:current_syntax") finish endif -" Read the C syntax to start with -if version < 600 - source :p:h/c.vim -else - runtime! syntax/c.vim -endif +runtime! syntax/c.vim " Configuration: " let xs_superseded = 0 " mark C functions superseded by Perl replacements (ex. memcpy vs Copy) @@ -3670,29 +3661,16 @@ syn keyword xsMacro whichsig write xio_any xio_dirp xiv_iv xlv_targoff syn keyword xsMacro xpv_len xuv_uv yystype " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_xs_syntax_inits") - if version < 508 - let did_xs_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink xsPrivate Error - HiLink xsSuperseded Error - HiLink xsType Type - HiLink xsString String - HiLink xsConstant Constant - HiLink xsException Exception - HiLink xsKeyword Keyword - HiLink xsFunction Function - HiLink xsVariable Identifier - HiLink xsMacro Macro - - delcommand HiLink -endif +hi def link xsPrivate Error +hi def link xsSuperseded Error +hi def link xsType Type +hi def link xsString String +hi def link xsConstant Constant +hi def link xsException Exception +hi def link xsKeyword Keyword +hi def link xsFunction Function +hi def link xsVariable Identifier +hi def link xsMacro Macro let b:current_syntax = "xs"