From cc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 1 Mar 2021 13:44:50 +0100 Subject: Update --- syntax/Jenkinsfile.vim | 1 + syntax/basic.vim | 62 ++++---- syntax/basic/literal.vim | 6 +- syntax/basic/type.vim | 3 +- syntax/c.vim | 28 ++-- syntax/cabal-1.vim | 2 +- syntax/carp.vim | 10 +- syntax/cpp.vim | 17 ++- syntax/crystal.vim | 6 +- syntax/embeddedpuppet.vim | 33 ----- syntax/epuppet.vim | 33 +++++ syntax/groovy.vim | 7 +- syntax/haskell.vim | 19 ++- syntax/html.vim | 25 +++- syntax/julia.vim | 10 +- syntax/kotlin.vim | 28 ++-- syntax/lhaskell.vim | 23 ++- syntax/messages.vim | 3 +- syntax/nginx.vim | 1 - syntax/ocaml.vim | 18 ++- syntax/pgsql.vim | 38 +++-- syntax/puppet.vim | 6 +- syntax/rst.vim | 7 +- syntax/smt2.vim | 26 ++-- syntax/tidy.vim | 195 ++++++++++++++++++++---- syntax/zig.vim | 370 ++++++++++++++++++++++++++++++++++------------ 26 files changed, 693 insertions(+), 284 deletions(-) delete mode 100644 syntax/embeddedpuppet.vim create mode 100644 syntax/epuppet.vim (limited to 'syntax') diff --git a/syntax/Jenkinsfile.vim b/syntax/Jenkinsfile.vim index 99b8707e..5959fd70 100644 --- a/syntax/Jenkinsfile.vim +++ b/syntax/Jenkinsfile.vim @@ -11,6 +11,7 @@ syn keyword jenkinsfileDirective environment options parameters triggers stage t syn keyword jenkinsfileOption contained buildDiscarder disableConcurrentBuilds overrideIndexTriggers skipDefaultCheckout nextgroup=jenkinsfileOptionParams syn keyword jenkinsfileOption contained skipStagesAfterUnstable checkoutToSubdirectory timeout retry timestamps nextgroup=jenkinsfileOptionParams +syn keyword jenkinsfileOption contained disableResume newContainerPerStage preserveStashes quietPeriod parallelsAlwaysFailFast nextgroup=jenkinsfileOptionParams syn region jenkinsfileOptionParams contained start='(' end=')' transparent contains=@groovyTop syn match jenkinsfileOptionO /[a-zA-Z]\+([^)]*)/ contains=jenkinsfileOption,jenkinsfileOptionParams transparent containedin=groovyParenT1 diff --git a/syntax/basic.vim b/syntax/basic.vim index 1b98eb8d..3502fa14 100644 --- a/syntax/basic.vim +++ b/syntax/basic.vim @@ -3,16 +3,18 @@ if polyglot#init#is_disabled(expand(':p'), 'basic', 'syntax/basic.vim') endif " Vim syntax file -" Language: BASIC -" Maintainer: Allan Kelly -" Last Change: 2011 Dec 25 by Thilo Six +" Language: BASIC +" Maintainer: Doug Kearns +" Previous Maintainer: Allan Kelly +" Contributors: Thilo Six +" Last Change: 2015 Jan 10 " First version based on Micro$soft QBASIC circa 1989, as documented in " 'Learn BASIC Now' by Halvorson&Rygmyr. Microsoft Press 1989. " This syntax file not a complete implementation yet. Send suggestions to the " maintainer. -" quit when a syntax file was already loaded +" Prelude {{{1 if exists("b:current_syntax") finish endif @@ -20,7 +22,7 @@ endif let s:cpo_save = &cpo set cpo&vim -" A bunch of useful BASIC keywords +" Keywords {{{1 syn keyword basicStatement BEEP beep Beep BLOAD bload Bload BSAVE bsave Bsave syn keyword basicStatement CALL call Call ABSOLUTE absolute Absolute syn keyword basicStatement CHAIN chain Chain CHDIR chdir Chdir @@ -120,32 +122,39 @@ syn keyword basicFunction RIGHT$ right$ Right$ RTRIM$ rtrim$ Rtrim$ syn keyword basicFunction SPACE$ space$ Space$ STR$ str$ Str$ syn keyword basicFunction STRING$ string$ String$ TIME$ time$ Time$ syn keyword basicFunction UCASE$ ucase$ Ucase$ VARPTR$ varptr$ Varptr$ -syn keyword basicTodo contained TODO -"integer number, or floating point number without a dot. +" Numbers {{{1 +" Integer number, or floating point number without a dot. syn match basicNumber "\<\d\+\>" -"floating point number, with dot +" Floating point number, with dot syn match basicNumber "\<\d\+\.\d*\>" -"floating point number, starting with a dot +" Floating point number, starting with a dot syn match basicNumber "\.\d\+\>" -" String and Character contstants -syn match basicSpecial contained "\\\d\d\d\|\\." -syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial +" String and Character constants {{{1 +syn match basicSpecial "\\\d\d\d\|\\." contained +syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial -syn region basicComment start="REM" end="$" contains=basicTodo -syn region basicComment start="^[ \t]*'" end="$" contains=basicTodo +" Line numbers {{{1 syn region basicLineNumber start="^\d" end="\s" -syn match basicTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1 + +" Data-type suffixes {{{1 +syn match basicTypeSpecifier "[a-zA-Z0-9][$%&!#]"ms=s+1 " Used with OPEN statement syn match basicFilenumber "#\d\+" -"syn sync ccomment basicComment + +" Mathematical operators {{{1 " syn match basicMathsOperator "[<>+\*^/\\=-]" -syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR" +syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR" -" Define the default highlighting. -" Only when an item doesn't have highlighting yet +" Comments {{{1 +syn keyword basicTodo TODO FIXME XXX NOTE contained +syn region basicComment start="^\s*\zsREM\>" start="\%(:\s*\)\@<=REM\>" end="$" contains=basicTodo +syn region basicComment start="'" end="$" contains=basicTodo +"syn sync ccomment basicComment + +" Default Highlighting {{{1 hi def link basicLabel Label hi def link basicConditional Conditional hi def link basicRepeat Repeat @@ -154,17 +163,18 @@ hi def link basicNumber Number hi def link basicError Error hi def link basicStatement Statement hi def link basicString String -hi def link basicComment Comment -hi def link basicSpecial Special +hi def link basicComment Comment +hi def link basicSpecial Special hi def link basicTodo Todo -hi def link basicFunction Identifier -hi def link basicTypeSpecifier Type -hi def link basicFilenumber basicTypeSpecifier +hi def link basicFunction Identifier +hi def link basicTypeSpecifier Type +hi def link basicFilenumber basicTypeSpecifier "hi basicMathsOperator term=bold cterm=bold gui=bold - +" Postscript {{{1 let b:current_syntax = "basic" let &cpo = s:cpo_save unlet s:cpo_save -" vim: ts=8 + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/syntax/basic/literal.vim b/syntax/basic/literal.vim index 81bbef96..de71af92 100644 --- a/syntax/basic/literal.vim +++ b/syntax/basic/literal.vim @@ -13,9 +13,11 @@ syntax region typescriptTemplateSubstitution matchgroup=typescriptTemplateSB \ contained -syntax region typescriptString +syntax region typescriptString \ start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ end=+$+ \ contains=typescriptSpecial,@Spell + \ nextgroup=@typescriptSymbols + \ skipwhite skipempty \ extend syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{1,6}})|c\u|.)" @@ -42,4 +44,4 @@ syntax match typescriptNumber /\<0[bB][01][01_]*\>/ nextgroup=@typescript syntax match typescriptNumber /\<0[oO][0-7][0-7_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty syntax match typescriptNumber /\<0[xX][0-9a-fA-F][0-9a-fA-F_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty syntax match typescriptNumber /\<\%(\d[0-9_]*\%(\.\d[0-9_]*\)\=\|\.\d[0-9_]*\)\%([eE][+-]\=\d[0-9_]*\)\=\>/ - \ nextgroup=typescriptSymbols skipwhite skipempty + \ nextgroup=@typescriptSymbols skipwhite skipempty diff --git a/syntax/basic/type.vim b/syntax/basic/type.vim index 770d3e0d..590dda1a 100644 --- a/syntax/basic/type.vim +++ b/syntax/basic/type.vim @@ -132,7 +132,7 @@ syntax region typescriptGenericFunc matchgroup=typescriptTypeBrackets \ contained skipwhite skipnl syntax region typescriptFuncType matchgroup=typescriptParens - \ start=/(/ end=/)\s*=>/me=e-2 + \ start=/(\(\k\+:\|)\)\@=/ end=/)\s*=>/me=e-2 \ contains=@typescriptParameterList \ nextgroup=typescriptFuncTypeArrow \ contained skipwhite skipnl oneline @@ -142,7 +142,6 @@ syntax match typescriptFuncTypeArrow /=>/ \ containedin=typescriptFuncType \ contained skipwhite skipnl - syntax keyword typescriptConstructorType new \ nextgroup=@typescriptFunctionType \ contained skipwhite skipnl diff --git a/syntax/c.vim b/syntax/c.vim index cb52a22f..a11a95a2 100644 --- a/syntax/c.vim +++ b/syntax/c.vim @@ -5,7 +5,7 @@ endif " Vim syntax file " Language: C " Maintainer: Bram Moolenaar -" Last Change: 2019 Nov 29 +" Last Change: 2021 Jan 11 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -17,6 +17,9 @@ set cpo&vim let s:ft = matchstr(&ft, '^\([^.]\)\+') +" check if this was included from cpp.vim +let s:in_cpp_family = exists("b:filetype_in_cpp_family") + " Optional embedded Autodoc parsing " To enable it add: let g:c_autodoc = 1 " to your .vimrc @@ -59,7 +62,7 @@ if !exists("c_no_cformat") endif " cCppString: same as cString, but ends at end of line -if s:ft ==# "cpp" && !exists("cpp_no_cpp11") && !exists("c_no_cformat") +if s:in_cpp_family && !exists("cpp_no_cpp11") && !exists("c_no_cformat") " ISO C++11 syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell @@ -91,7 +94,7 @@ syn match cSpecialCharacter display "L\='\\\o\{1,3}'" syn match cSpecialCharacter display "'\\x\x\{1,2}'" syn match cSpecialCharacter display "L'\\x\x\+'" -if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11")) +if (s:ft ==# "c" && !exists("c_no_c11")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) " ISO C11 or ISO C++ 11 if exists("c_no_cformat") syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend @@ -134,7 +137,7 @@ endif " But avoid matching <::. syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom if exists("c_no_curly_error") - if s:ft ==# 'cpp' && !exists("cpp_no_cpp11") + if s:in_cpp_family && !exists("cpp_no_cpp11") syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell " cCppParen: same as cParen but ends at end-of-line; used in cDefine syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell @@ -148,7 +151,7 @@ if exists("c_no_curly_error") syn match cErrInParen display contained "^[{}]\|^<%\|^%>" endif elseif exists("c_no_bracket_error") - if s:ft ==# 'cpp' && !exists("cpp_no_cpp11") + if s:in_cpp_family && !exists("cpp_no_cpp11") syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell " cCppParen: same as cParen but ends at end-of-line; used in cDefine syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell @@ -162,7 +165,7 @@ elseif exists("c_no_bracket_error") syn match cErrInParen display contained "[{}]\|<%\|%>" endif else - if s:ft ==# 'cpp' && !exists("cpp_no_cpp11") + if s:in_cpp_family && !exists("cpp_no_cpp11") syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell " cCppParen: same as cParen but ends at end-of-line; used in cDefine syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell @@ -276,12 +279,13 @@ if exists("c_gnu") syn keyword cType __label__ __complex__ __volatile__ endif -syn keyword cStructure struct union enum typedef +syn keyword cTypedef typedef +syn keyword cStructure struct union enum syn keyword cStorageClass static register auto volatile extern const if exists("c_gnu") syn keyword cStorageClass inline __attribute__ endif -if !exists("c_no_c99") && s:ft !=# 'cpp' +if !exists("c_no_c99") && !s:in_cpp_family syn keyword cStorageClass inline restrict endif if !exists("c_no_c11") @@ -315,8 +319,7 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") if exists("c_gnu") syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__ endif - syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ - syn keyword cConstant __STDC_VERSION__ + syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ __STDC_VERSION__ __STDC_HOSTED__ syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN @@ -350,6 +353,8 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2 syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF FOPEN_MAX FILENAME_MAX L_tmpnam syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET TMP_MAX stderr stdin stdout EXIT_FAILURE EXIT_SUCCESS RAND_MAX + " used in assert.h + syn keyword cConstant NDEBUG " POSIX 2001 syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG SIGVTALRM SIGXCPU SIGXFSZ " non-POSIX signals @@ -422,7 +427,7 @@ endif syn cluster cLabelGroup contains=cUserLabel syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup -if s:ft ==# 'cpp' +if s:in_cpp_family syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup else @@ -479,6 +484,7 @@ hi def link cSpecialError cError hi def link cCurlyError cError hi def link cOperator Operator hi def link cStructure Structure +hi def link cTypedef Structure hi def link cStorageClass StorageClass hi def link cInclude Include hi def link cPreProc PreProc diff --git a/syntax/cabal-1.vim b/syntax/cabal-1.vim index c473800a..e7a892a3 100644 --- a/syntax/cabal-1.vim +++ b/syntax/cabal-1.vim @@ -25,7 +25,7 @@ syn match cabalDocBulletPoint "^\s\+\*" syn match cabalDocHeadline "^\s\+=.*$" syn match cabalDocCode "^\s\+>.*$" syn match cabalDocNewline "^\s\+\.\s*$" -syn match cabalSection "^\c\(executable\|library\|flag\|source-repository\|test-suite\|benchmark\)" +syn match cabalSection "^\c\(executable\|library\|flag\|source-repository\|test-suite\|benchmark\|common\)" syn match cabalEntry "^\s*[A-Za-z][a-zA-Z\-]*:" contains=cabalIdentifier,cabalColon syn region cabalDescription start="^\s*[dD]escription:" end="^\<" keepend diff --git a/syntax/carp.vim b/syntax/carp.vim index a3f11c66..849c3247 100644 --- a/syntax/carp.vim +++ b/syntax/carp.vim @@ -33,6 +33,7 @@ syn keyword carpSyntax str* println* break doc sig hidden private syn keyword carpSyntax while-do const-assert save-docs defproject syn keyword carpSyntax relative-include not-on-windows load-and-use syn keyword carpSyntax deftest +syn keyword carpSyntax quasiquote unquote unquote-splicing syn match carpSyntax "\vc(a|d){1,4}r" syn keyword carpFunc λ @@ -55,7 +56,7 @@ syn keyword carpFunc string-join free sleep-seconds sleep-micros substitute syn keyword carpFunc neg to-float match matches? find global-match match-str syn keyword carpFunc from-float tan asin atan cosh sinh tanh exp frexp ldexp syn keyword carpFunc log log10 modf pow ceil clamp approx refstr foreach -syn keyword carpFunc => ==> repeat nth replicate range raw aset aset! +syn keyword carpFunc -> --> => ==> repeat nth replicate range raw aset aset! syn keyword carpFunc push-back pop-back sort index-of element-count syn keyword carpFunc apply unsafe-from from just? nothing? ptr from-ptr syn keyword carpFunc map and-then unwrap-or-zero or-else unwrap-or-else @@ -126,6 +127,13 @@ syn match carpComment /;.*$/ contains=@Spell syn region carpQuoted matchgroup=Delimiter start="#['`]"rs=s+2 end=![ \t()\[\]";]!re=e-1,me=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal syn region carpQuoted matchgroup=Delimiter start="#['`]("rs=s+3 matchgroup=Delimiter end=")"re=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal +syn region carpUnquote matchgroup=Delimiter start="%"rs=s+1 end=![ \t\[\]()";]!re=e-1,me=e-1 contained contains=@carpNormal +syn region carpUnquote matchgroup=Delimiter start="%@"rs=s+2 end=![ \t\[\]()";]!re=e-1,me=e-1 contained contains=@carpNormal +syn region carpUnquote matchgroup=Delimiter start="%@("rs=s+2 end=")"re=e-1 contained contains=@carpNormal +syn region carpUnquote matchgroup=Delimiter start="%("rs=s+2 end=")"re=e-1 contained contains=@carpNormal + +syn cluster carpQuotedStuff add=carpUnquote + syn cluster carpNormal add=carpQuoted,carpComment syn cluster carpQuotedOrNormal add=carpComment diff --git a/syntax/cpp.vim b/syntax/cpp.vim index 0fd0acc2..a31f3416 100644 --- a/syntax/cpp.vim +++ b/syntax/cpp.vim @@ -6,13 +6,16 @@ endif " Language: C++ " Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp) " Previous Maintainer: Ken Shan -" Last Change: 2017 Jun 05 +" Last Change: 2021 Jan 12 " quit when a syntax file was already loaded if exists("b:current_syntax") finish endif +" inform C syntax that the file was included from cpp.vim +let b:filetype_in_cpp_family = 1 + " Read the C syntax to start with runtime! syntax/c.vim unlet b:current_syntax @@ -59,12 +62,6 @@ if !exists("cpp_no_cpp14") syn case match endif -" C++ 17 extensions -if !exists("cpp_no_cpp17") - syn match cppCast "\]?" diff --git a/syntax/crystal.vim b/syntax/crystal.vim index a776e59b..ea862acd 100644 --- a/syntax/crystal.vim +++ b/syntax/crystal.vim @@ -95,8 +95,6 @@ syn match crystalStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C syn region crystalInterpolation matchgroup=crystalInterpolationDelim start="#{" end="}" contained contains=TOP syn region crystalNoInterpolation start="\\#{" end="}" contained syn match crystalNoInterpolation "\\#{" display contained -syn match crystalNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained -syn match crystalNoInterpolation "\\#\$\W" display contained syn match crystalDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE @@ -261,10 +259,10 @@ syn cluster crystalDeclaration contains=crystalAliasDeclaration,crystalAliasDecl " Note: the following keywords have already been defined: " begin case class def do end for if module unless until while syn match crystalControl "\<\%(break\|next\|rescue\|return\)\>[?!]\@!" -syn match crystalKeyword "\<\%(super\|previous_def\|yield\|of\|with\|uninitialized\|union\)\>[?!]\@!" +syn match crystalKeyword "\<\%(super\|previous_def\|yield\|of\|with\|uninitialized\|union\|out\)\>[?!]\@!" syn match crystalBoolean "\<\%(true\|false\)\>[?!]\@!" syn match crystalPseudoVariable "\<\%(nil\|__DIR__\|__FILE__\|__LINE__\|__END_LINE__\)\>[?!]\@!" " TODO: reorganise -syn match crystalPseudoVariable "\" +syn match crystalPseudoVariable "\[?!]\@!" " Expensive Mode - match 'end' with the appropriate opening keyword for syntax " based folding and special highlighting of module/class/method definitions diff --git a/syntax/embeddedpuppet.vim b/syntax/embeddedpuppet.vim deleted file mode 100644 index dad9e1fb..00000000 --- a/syntax/embeddedpuppet.vim +++ /dev/null @@ -1,33 +0,0 @@ -if polyglot#init#is_disabled(expand(':p'), 'puppet', 'syntax/embeddedpuppet.vim') - finish -endif - -" Vim syntax plugin -" Language: embedded puppet -" Maintainer: Gabriel Filion -" URL: https://github.com/rodjek/vim-puppet -" Last Change: 2019-09-01 - -" quit when a syntax file was already loaded {{{1 -if exists("b:current_syntax") - finish -endif - -runtime! syntax/sh.vim -unlet! b:current_syntax - -syn include @puppetTop syntax/puppet.vim - -syn cluster ePuppetRegions contains=ePuppetBlock,ePuppetExpression,ePuppetComment - -syn region ePuppetBlock matchgroup=ePuppetDelimiter start="<%%\@!-\=" end="[=-]\=%\@" contains=@puppetTop containedin=ALLBUT,@ePuppetRegions keepend -syn region ePuppetExpression matchgroup=ePuppetDelimiter start="<%=\{1,4}" end="[=-]\=%\@" contains=@puppetTop containedin=ALLBUT,@ePuppetRegions keepend -syn region ePuppetComment matchgroup=ePuppetDelimiter start="<%-\=#" end="[=-]\=%\@" contains=puppetTodo,@Spell containedin=ALLBUT,@ePuppetRegions keepend - -" Define the default highlighting. - -hi def link ePuppetDelimiter PreProc -hi def link ePuppetComment Comment - -let b:current_syntax = "embeddedpuppet" - diff --git a/syntax/epuppet.vim b/syntax/epuppet.vim new file mode 100644 index 00000000..61c70d21 --- /dev/null +++ b/syntax/epuppet.vim @@ -0,0 +1,33 @@ +if polyglot#init#is_disabled(expand(':p'), 'puppet', 'syntax/epuppet.vim') + finish +endif + +" Vim syntax plugin +" Language: embedded puppet +" Maintainer: Gabriel Filion +" URL: https://github.com/rodjek/vim-puppet +" Last Change: 2019-09-01 + +" quit when a syntax file was already loaded {{{1 +if exists("b:current_syntax") + finish +endif + +runtime! syntax/sh.vim +unlet! b:current_syntax + +syn include @puppetTop syntax/puppet.vim + +syn cluster ePuppetRegions contains=ePuppetBlock,ePuppetExpression,ePuppetComment + +syn region ePuppetBlock matchgroup=ePuppetDelimiter start="<%%\@!-\=" end="[=-]\=%\@" contains=@puppetTop containedin=ALLBUT,@ePuppetRegions keepend +syn region ePuppetExpression matchgroup=ePuppetDelimiter start="<%=\{1,4}" end="[=-]\=%\@" contains=@puppetTop containedin=ALLBUT,@ePuppetRegions keepend +syn region ePuppetComment matchgroup=ePuppetDelimiter start="<%-\=#" end="[=-]\=%\@" contains=puppetTodo,@Spell containedin=ALLBUT,@ePuppetRegions keepend + +" Define the default highlighting. + +hi def link ePuppetDelimiter PreProc +hi def link ePuppetComment Comment + +let b:current_syntax = "epuppet" + diff --git a/syntax/groovy.vim b/syntax/groovy.vim index fdadca90..87fc89df 100644 --- a/syntax/groovy.vim +++ b/syntax/groovy.vim @@ -6,9 +6,9 @@ endif " Language: Groovy " Original Author: Alessio Pace " Maintainer: Tobias Rapp -" Version: 0.1.17 +" Version: 0.1.18 " URL: http://www.vim.org/scripts/script.php?script_id=945 -" Last Change: 2020 May 26 +" Last Change: 2021 Feb 03 " THE ORIGINAL AUTHOR'S NOTES: " @@ -257,7 +257,8 @@ if exists("groovy_regex_strings") endif " syn region groovyELExpr start=+${+ end=+}+ keepend contained syn match groovyELExpr /\${.\{-}}/ contained -syn match groovyELExpr /\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained +" Fix: force use of the NFA regexp engine (2), see GitHub issue #7280 +syn match groovyELExpr /\%#=2\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained hi def link groovyELExpr Identifier " TODO: better matching. I am waiting to understand how it really works in groovy diff --git a/syntax/haskell.vim b/syntax/haskell.vim index 52c33190..efe30323 100644 --- a/syntax/haskell.vim +++ b/syntax/haskell.vim @@ -40,7 +40,12 @@ syn match haskellTypeSig \ haskellParens syn keyword haskellWhere where syn keyword haskellLet let -syn match HaskellDerive "\\(\s\+\<\(anyclass\|instance\|newtype\|stock\)\>\)\?" +syn keyword haskellDeriveKeyword deriving anyclass instance newtype stock via contained +syn match haskellDerive "deriving\(\s\+instance\)\?\(\s\+anyclass\|\s\+newtype\|\s\+stock\|\s\+.\{-}\_s\+via\)\?" + \ contains= + \ haskellDeriveKeyword, + \ haskellParens, + \ haskellType syn keyword haskellDeclKeyword module class instance newtype in syn match haskellDecl "\<\(type\|data\)\>\s\+\(\\)\?" syn keyword haskellDefault default @@ -67,8 +72,8 @@ if get(g:, 'haskell_enable_static_pointers', 0) syn keyword haskellStatic static endif syn keyword haskellConditional if then else -syn match haskellNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>\|\<0[bB][10]\+\>" -syn match haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>" +syn match haskellNumber "\<[0-9]\+\>\|\<[0-9_]\+\>\|\<0[xX][0-9a-fA-F_]\+\>\|\<0[oO][0-7_]\+\>\|\<0[bB][10_]\+\>" +syn match haskellFloat "\<[0-9]\+\.[0-9_]\+\([eE][-+]\=[0-9_]\+\)\=\>" syn match haskellSeparator "[,;]" syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP,haskellTypeSig,@Spell syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP,haskellTypeSig,@Spell @@ -94,7 +99,7 @@ syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" syn match haskellBacktick "`[A-Za-z_][A-Za-z0-9_\.']*#\?`" syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+ \ contains=@Spell -syn match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained +syn match haskellIdentifier "[_a-z][a-zA-Z0-9_']*" contained syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>" syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>" syn region haskellBlockComment start="{-" end="-}" @@ -110,7 +115,7 @@ syn keyword haskellTodo TODO FIXME contained syn match haskellShebang "\%^#!.*$" if !get(g:, 'haskell_disable_TH', 0) syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained - syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-zA-Z][a-zA-z0-9._']*|" end="|\]" + syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-zA-Z][a-zA-Z0-9._']*|" end="|\]" syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP endif @@ -165,13 +170,13 @@ highlight def link haskellType Type highlight def link haskellImportKeywords Include if get(g:, 'haskell_classic_highlighting', 0) highlight def link haskellDeclKeyword Keyword - highlight def link HaskellDerive Keyword + highlight def link haskellDeriveKeyword Keyword highlight def link haskellDecl Keyword highlight def link haskellWhere Keyword highlight def link haskellLet Keyword else highlight def link haskellDeclKeyword Structure - highlight def link HaskellDerive Structure + highlight def link haskellDeriveKeyword Structure highlight def link haskellDecl Structure highlight def link haskellWhere Structure highlight def link haskellLet Structure diff --git a/syntax/html.vim b/syntax/html.vim index c823d362..2113f12a 100644 --- a/syntax/html.vim +++ b/syntax/html.vim @@ -4,11 +4,11 @@ endif " Vim syntax file " Language: HTML -" Maintainer: Jorge Maldonado Ventura +" Previous Maintainer: Jorge Maldonado Ventura " Previous Maintainer: Claudio Fleiner " Repository: https://notabug.org/jorgesumle/vim-html-syntax -" Last Change: 2020 Mar 17 -" Included patch from Florian Breisch to add the summary element +" Last Change: 2021 Feb 25 +" Included patch #7900 to fix comments " " Please check :help html.vim for some comments and a description of the options @@ -145,9 +145,21 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" if exists("html_wrong_comments") syn region htmlComment start=+ and are parser errors; browser treats as comments + syn match htmlComment " closes comment + " Idem 8.2.4.52: closing comment by dash-dash-bang (--!>) is error ignored by parser(!); closes comment + syn region htmlCommentPart contained start=+--+ end=+--!\?>+me=e-1 contains=htmlCommentNested,@htmlPreProc,@Spell + " Idem 8.2.4.49: opening nested comment is all right + syn match htmlCommentNested contained ""me=e-3 + syn match htmlCommentNested contained "