summaryrefslogtreecommitdiffstats
path: root/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'syntax')
-rw-r--r--syntax/crystal.vim64
-rw-r--r--syntax/dart.vim2
-rw-r--r--syntax/elixir.vim4
-rw-r--r--syntax/git.vim2
-rw-r--r--syntax/gohtmltmpl.vim4
-rw-r--r--syntax/haskell.vim2
-rw-r--r--syntax/i3.vim4
-rw-r--r--syntax/javascript.vim123
-rw-r--r--syntax/mason.vim46
-rw-r--r--syntax/nim.vim33
-rw-r--r--syntax/perl.vim198
-rw-r--r--syntax/php.vim2
-rw-r--r--syntax/pod.vim40
-rw-r--r--syntax/purescript.vim32
-rw-r--r--syntax/qml.vim22
-rw-r--r--syntax/scala.vim15
-rw-r--r--syntax/toml.vim10
-rw-r--r--syntax/twig.vim3
-rw-r--r--syntax/xs.vim46
19 files changed, 304 insertions, 348 deletions
diff --git a/syntax/crystal.vim b/syntax/crystal.vim
index 0ddf7653..5b13d4c1 100644
--- a/syntax/crystal.vim
+++ b/syntax/crystal.vim
@@ -11,17 +11,17 @@ endif
syn cluster crystalNotTop contains=@crystalExtendedStringSpecial,@crystalRegexpSpecial,@crystalDeclaration,crystalConditional,crystalExceptional,crystalMethodExceptional,crystalTodo,crystalLinkAttr
-if exists('crystal_space_errors')
- if !exists('crystal_no_trail_space_error')
+if exists('g:crystal_space_errors')
+ if !exists('g:crystal_no_trail_space_error')
syn match crystalSpaceError display excludenl "\s\+$"
endif
- if !exists('crystal_no_tab_space_error')
+ if !exists('g:crystal_no_tab_space_error')
syn match crystalSpaceError display " \+\t"me=e-1
endif
endif
" Operators
-if exists('crystal_operators')
+if exists('g:crystal_operators')
syn match crystalOperator "[~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::"
syn match crystalOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!="
syn region crystalBracketOperator matchgroup=crystalOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@crystalNotTop
@@ -170,39 +170,39 @@ syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-'\z([^']*\)'\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart fold keepend
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial fold keepend
-if exists('main_syntax') && g:main_syntax ==# 'ecrystal'
+if exists('g:main_syntax') && g:main_syntax ==# 'ecrystal'
let b:crystal_no_expensive = 1
end
-syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
-syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
-syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
-syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalConstant
-syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalConstant
-syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
-syn match crystalModuleDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
-syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
-syn match crystalLibDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
-syn match crystalMacroDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant,crystalOperator
-syn match crystalEnumDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant
-syn match crystalFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=crystalMethodDeclaration,crystalFunctionDeclaration
-syn match crystalFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2
-syn match crystalFunction "\%([[:space:].]\|^\)\@<=\%(\[\][=?]\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration
+syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
+syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
+syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
+syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalConstant
+syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalConstant
+syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
+syn match crystalModuleDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
+syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
+syn match crystalLibDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
+syn match crystalMacroDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant,crystalOperator
+syn match crystalEnumDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant
+syn match crystalFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=crystalMethodDeclaration,crystalFunctionDeclaration
+syn match crystalFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2
+syn match crystalFunction "\%([[:space:].]\|^\)\@<=\%(\[\][=?]\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration
syn cluster crystalDeclaration contains=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration,crystalModuleDeclaration,crystalClassDeclaration,crystalStructDeclaration,crystalLibDeclaration,crystalMacroDeclaration,crystalFunction,crystalBlockParameter,crystalTypeDeclaration,crystalEnumDeclaration
" Keywords
" Note: the following keywords have already been defined:
" begin case class def do end for if module unless until while
-syn match crystalControl "\<\%(break\|in\|next\|rescue\|return\)\>[?!]\@!"
-syn match crystalOperator "\<defined?" display
-syn match crystalKeyword "\<\%(super\|previous_def\|yield\|as\|of\|with\)\>[?!]\@!"
-syn match crystalBoolean "\<\%(true\|false\)\>[?!]\@!"
-syn match crystalPseudoVariable "\<\%(nil\|self\|__DIR__\|__FILE__\|__LINE__\)\>[?!]\@!" " TODO: reorganise
+syn match crystalControl "\<\%(break\|in\|next\|rescue\|return\)\>[?!]\@!"
+syn match crystalOperator "\<defined?" display
+syn match crystalKeyword "\<\%(super\|previous_def\|yield\|of\|with\|uninitialized\|union\)\>[?!]\@!"
+syn match crystalBoolean "\<\%(true\|false\)\>[?!]\@!"
+syn match crystalPseudoVariable "\<\%(nil\|self\|__DIR__\|__FILE__\|__LINE__\|__END_LINE__\)\>[?!]\@!" " TODO: reorganise
" Expensive Mode - match 'end' with the appropriate opening keyword for syntax
" based folding and special highlighting of module/class/method definitions
-if !exists('b:crystal_no_expensive') && !exists('crystal_no_expensive')
+if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
syn match crystalDefine "\<alias\>" nextgroup=crystalAliasDeclaration skipwhite skipnl
syn match crystalDefine "\<def\>" nextgroup=crystalMethodDeclaration skipwhite skipnl
syn match crystalDefine "\<fun\>" nextgroup=crystalFunctionDeclaration skipwhite skipnl
@@ -246,10 +246,10 @@ if !exists('b:crystal_no_expensive') && !exists('crystal_no_expensive')
syn region crystalOptionalDoLine matchgroup=crystalRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@crystalNotTop
syn region crystalRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalRepeat end="\<end\>" contains=ALLBUT,@crystalNotTop nextgroup=crystalOptionalDoLine fold
- if !exists('crystal_minlines')
- let crystal_minlines = 500
+ if !exists('g:crystal_minlines')
+ let g:crystal_minlines = 500
endif
- exec 'syn sync minlines=' . crystal_minlines
+ exec 'syn sync minlines=' . g:crystal_minlines
else
syn match crystalControl "\<def\>[?!]\@!" nextgroup=crystalMethodDeclaration skipwhite skipnl
@@ -271,7 +271,7 @@ syn match crystalLinkAttr "@\[" contained containedin=crystalLinkAttrRegion disp
syn match crystalLinkAttr "]" contained containedin=crystalLinkAttrRegion display
" Special Methods
-if !exists('crystal_no_special_methods')
+if !exists('g:crystal_no_special_methods')
syn keyword crystalAccess protected private
" attr is a common variable name
syn keyword crystalAttribute getter setter property abstract
@@ -293,7 +293,7 @@ syn match crystalMacro "\%({%\|%}\|{{\|}}\)" nextgroup=crystalMacroRegion skipwh
syn match crystalSharpBang "\%^#!.*" display
syn keyword crystalTodo FIXME NOTE TODO OPTIMIZE XXX todo contained
syn match crystalComment "#.*" contains=crystalSharpBang,crystalSpaceError,crystalTodo,@Spell
-if !exists('crystal_no_comment_fold')
+if !exists('g:crystal_no_comment_fold')
syn region crystalMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=crystalComment transparent fold keepend
endif
@@ -307,7 +307,7 @@ syn match crystalKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)
syn match crystalKeywordAsMethod "\<\%(if\|ifdef\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|caller\|exit\)\>" transparent contains=NONE
-syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fork\|include\)\>" transparent contains=NONE
+syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fork\|include\|asm\)\>" transparent contains=NONE
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(loop\|private\|protected\)\>" transparent contains=NONE
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(require\|raise\)\>" transparent contains=NONE
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(typeof\|pointerof\|sizeof\|instance_sizeof\|\)\>" transparent contains=NONE
@@ -335,7 +335,7 @@ hi def link crystalASCIICode Character
hi def link crystalFloat Float
hi def link crystalBoolean Boolean
hi def link crystalException Exception
-if !exists('crystal_no_identifiers')
+if !exists('g:crystal_no_identifiers')
hi def link crystalIdentifier Identifier
else
hi def link crystalIdentifier NONE
diff --git a/syntax/dart.vim b/syntax/dart.vim
index 460c74a1..7847b98f 100644
--- a/syntax/dart.vim
+++ b/syntax/dart.vim
@@ -72,6 +72,7 @@ syntax keyword dartTodo contained TODO FIXME XXX
syntax region dartComment start="/\*" end="\*/" contains=dartComment,dartTodo,dartDocLink,@Spell
syntax match dartLineComment "//.*" contains=dartTodo,@Spell
syntax match dartLineDocComment "///.*" contains=dartTodo,dartDocLink,@Spell
+syntax match dartShebangLine /^\%1l#!.*/
syntax region dartDocLink oneline contained start=+\[+ end=+\]+
" Strings
@@ -110,6 +111,7 @@ highlight default link dartOperator Operator
highlight default link dartComment Comment
highlight default link dartLineComment Comment
highlight default link dartLineDocComment Comment
+highlight default link dartShebangLine Comment
highlight default link dartConstant Constant
highlight default link dartTypedef Typedef
highlight default link dartTodo Todo
diff --git a/syntax/elixir.vim b/syntax/elixir.vim
index beb1317d..ba1f10c0 100644
--- a/syntax/elixir.vim
+++ b/syntax/elixir.vim
@@ -120,10 +120,10 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=
" Documentation
if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs
syn include @markdown syntax/markdown.vim
- syn cluster elixirDocStringContained contains=@markdown,@Spell
+ syn cluster elixirDocStringContained contains=@markdown,@Spell,elixirInterpolation
else
let g:elixir_use_markdown_for_docs = 0
- syn cluster elixirDocStringContained contains=elixirDocTest,elixirTodo,@Spell
+ syn cluster elixirDocStringContained contains=elixirDocTest,elixirTodo,@Spell,elixirInterpolation
" doctests
syn region elixirDocTest start="^\s*\%(iex\|\.\.\.\)\%((\d*)\)\?>\s" end="^\s*$" contained
diff --git a/syntax/git.vim b/syntax/git.vim
index 964b0b8f..53f44d36 100644
--- a/syntax/git.vim
+++ b/syntax/git.vim
@@ -15,7 +15,7 @@ syn sync minlines=50
syn include @gitDiff syntax/diff.vim
syn region gitHead start=/\%^/ end=/^$/
-syn region gitHead start=/\%(^commit \x\{40\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/
+syn region gitHead start=/\%(^commit\%( \x\{40\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/
" For git reflog and git show ...^{tree}, avoid sync issues
syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/
diff --git a/syntax/gohtmltmpl.vim b/syntax/gohtmltmpl.vim
index 00432a0f..d4198417 100644
--- a/syntax/gohtmltmpl.vim
+++ b/syntax/gohtmltmpl.vim
@@ -4,8 +4,8 @@ if exists("b:current_syntax")
finish
endif
-if !exists("main_syntax")
- let main_syntax = 'html'
+if !exists("g:main_syntax")
+ let g:main_syntax = 'html'
endif
runtime! syntax/gotexttmpl.vim
diff --git a/syntax/haskell.vim b/syntax/haskell.vim
index bd5c02ce..048a40ea 100644
--- a/syntax/haskell.vim
+++ b/syntax/haskell.vim
@@ -99,6 +99,7 @@ syn region haskellBlockComment start="{-" end="-}"
\ haskellTodo,
\ @Spell
syn region haskellPragma start="{-#" end="#-}"
+syn region haskellLiquid start="{-@" end="@-}"
syn match haskellPreProc "^#.*$"
syn keyword haskellTodo TODO FIXME contained
" Treat a shebang line at the start of the file as a comment
@@ -147,6 +148,7 @@ highlight def link haskellShebang Comment
highlight def link haskellLineComment Comment
highlight def link haskellBlockComment Comment
highlight def link haskellPragma SpecialComment
+highlight def link haskellLiquid SpecialComment
highlight def link haskellString String
highlight def link haskellChar String
highlight def link haskellBacktick Operator
diff --git a/syntax/i3.vim b/syntax/i3.vim
index 437313b2..cbac6a53 100644
--- a/syntax/i3.vim
+++ b/syntax/i3.vim
@@ -35,6 +35,8 @@ syn match i3NoStartupId '--no-startup-id' contained
syn keyword i3WsSpecialParam next prev next_on_output prev_on_output back_and_forth current number
syn keyword i3BordersSpecialParam none vertical horizontal both
syn keyword i3ModeParam dock hide invisible skipwhite
+syn keyword i3GapsCommand gaps smart_gaps smart_borders
+syn keyword i3GapsParam inner outer current all set plus minus no_gaps
" these are not keywords but we add them for consistency
syn keyword i3PseudoParam no false inactive
@@ -99,6 +101,7 @@ highlight link i3ColorLast Constant
highlight link i3WsSpecialParam Constant
highlight link i3BordersSpecialParam Constant
highlight link i3ModeParam Constant
+highlight link i3GapsParam Constant
highlight link i3Var Identifier
highlight link i3SetVar Identifier
@@ -115,6 +118,7 @@ highlight link i3Font String
highlight link i3ExecKeyword Keyword
highlight link i3Command Keyword
highlight link i3WsKeyword Keyword
+highlight link i3GapsCommand Keyword
highlight link i3ColorDef1 Define
highlight link i3ColorDef3 Define
diff --git a/syntax/javascript.vim b/syntax/javascript.vim
index 2461833e..cd9e8531 100644
--- a/syntax/javascript.vim
+++ b/syntax/javascript.vim
@@ -26,17 +26,17 @@ syntax sync fromstart
" syntax case ignore
syntax case match
-syntax match jsNoise /[:,\;]\{1}/
-syntax match jsNoise /[\.]\{1}/ skipwhite skipempty nextgroup=jsObjectProp,jsFuncCall,jsPrototype,jsTaggedTemplate
-syntax match jsObjectProp contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/
-syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
+syntax match jsNoise /[:,;]/
+syntax match jsNoise /\./ skipwhite skipempty nextgroup=jsObjectProp,jsFuncCall,jsPrototype,jsTaggedTemplate
+syntax match jsObjectProp contained /\<\K\k*/
+syntax match jsFuncCall /\<\K\k*\ze\s*(/
syntax match jsParensError /[)}\]]/
" Program Keywords
syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray,jsVariableDef
-syntax match jsVariableDef contained /\k\+/ skipwhite skipempty nextgroup=jsFlowDefinition
+syntax match jsVariableDef contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFlowDefinition
syntax keyword jsOperator delete instanceof typeof void new in of skipwhite skipempty nextgroup=@jsExpression
-syntax match jsOperator /[\!\|\&\+\-\<\>\=\%\/\*\~\^]\{1}/ skipwhite skipempty nextgroup=@jsExpression
+syntax match jsOperator "[-!|&+<>=%/*~^]" skipwhite skipempty nextgroup=@jsExpression
syntax match jsOperator /::/ skipwhite skipempty nextgroup=@jsExpression
syntax keyword jsBooleanTrue true
syntax keyword jsBooleanFalse false
@@ -44,7 +44,7 @@ syntax keyword jsBooleanFalse false
" Modules
syntax keyword jsImport import skipwhite skipempty nextgroup=jsModuleAsterisk,jsModuleKeyword,jsModuleGroup,jsFlowImportType
syntax keyword jsExport export skipwhite skipempty nextgroup=@jsAll,jsModuleGroup,jsExportDefault,jsModuleAsterisk,jsModuleKeyword,jsFlowTypeStatement
-syntax match jsModuleKeyword contained /\k\+/ skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma
+syntax match jsModuleKeyword contained /\<\K\k*/ skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma
syntax keyword jsExportDefault contained default skipwhite skipempty nextgroup=@jsExpression
syntax keyword jsExportDefaultGroup contained default skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma
syntax match jsModuleAsterisk contained /\*/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAs,jsFrom
@@ -53,44 +53,37 @@ syntax keyword jsFrom contained from skipwhite skipempty nextgroup
syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAsterisk,jsModuleGroup,jsFlowTypeKeyword
" Strings, Templates, Numbers
-syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend
-syntax region jsString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend
-syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateExpression,jsSpecial,@Spell extend
-syntax match jsTaggedTemplate /\k\+\%(`\)\@=/ nextgroup=jsTemplateString
-syntax match jsNumber /\<\d\+\%([eE][+-]\=\d\+\)\=\>\|\<0[bB][01]\+\>\|\<0[oO]\o\+\>\|\<0[xX]\x\+\>/
+syntax region jsString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend
+syntax region jsTemplateString start=+`+ skip=+\\`+ end=+`+ contains=jsTemplateExpression,jsSpecial,@Spell extend
+syntax match jsTaggedTemplate /\<\K\k*\ze`/ nextgroup=jsTemplateString
+syntax match jsNumber /\c\<\%(\d\+\%(e[+-]\=\d\+\)\=\|0b[01]\+\|0o\o\+\|0x\x\+\)\>/
syntax keyword jsNumber Infinity
-syntax match jsFloat /\<\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
+syntax match jsFloat /\c\<\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%(e[+-]\=\d\+\)\=\>/
" Regular Expressions
-syntax match jsSpecial contained "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)"
+syntax match jsSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{4,5}})|c\u|.)"
syntax region jsTemplateExpression contained matchgroup=jsTemplateBraces start=+${+ end=+}+ contains=@jsExpression keepend
-syntax region jsRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+
-syntax match jsRegexpBoundary contained "\v%(\<@![\^$]|\\[bB])"
-syntax match jsRegexpBackRef contained "\v\\[1-9][0-9]*"
-syntax match jsRegexpQuantifier contained "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??"
-syntax match jsRegexpOr contained "\v\<@!\|"
-syntax match jsRegexpMod contained "\v\(@<=\?[:=!>]"
-syntax region jsRegexpGroup contained start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contains=jsRegexpCharClass,@jsRegexpSpecial keepend
-if v:version > 703 || v:version == 603 && has("patch1088")
- syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@50<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@50<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimyu]\{,5}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
-else
- syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimyu]\{,5}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
-endif
+syntax region jsRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+ contains=jsSpecial
+syntax match jsRegexpBoundary contained "\v\c[$^]|\\b"
+syntax match jsRegexpBackRef contained "\v\\[1-9]\d*"
+syntax match jsRegexpQuantifier contained "\v[^\\]%([?*+]|\{\d+%(,\d*)?})\??"lc=1
+syntax match jsRegexpOr contained "|"
+syntax match jsRegexpMod contained "\v\(\?[:=!>]"lc=1
+syntax region jsRegexpGroup contained start="[^\\]("lc=1 skip="\\.\|\[\(\\.\|[^]]\+\)\]" end=")" contains=jsRegexpCharClass,@jsRegexpSpecial keepend
+syntax region jsRegexpString start=+\%(\%(\<return\|\<typeof\|\_[^)\]'"[:blank:][:alnum:]_$]\)\s*\)\@<=/\ze[^*/]+ skip=+\\.\|\[[^]]\{1,}\]+ end=+/[gimyus]\{,6}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
" Objects
-syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue
+syntax match jsObjectKey contained /\<\K\k*\ze\s*:/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue
syntax match jsObjectColon contained /:/ skipwhite skipempty
-syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
-syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
+syntax region jsObjectKeyString contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend
syntax match jsObjectSeparator contained /,/
-syntax region jsObjectValue contained matchgroup=jsNoise start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend
-syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs
-syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/
-syntax match jsObjectMethodType contained /\%(get\|set\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsObjectFuncName
-syntax region jsObjectStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
-syntax region jsObjectStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
+syntax region jsObjectValue contained matchgroup=jsNoise start=/:/ end=/[,}]\@=/ contains=@jsExpression extend
+syntax match jsObjectFuncName contained /\<\K\k*\ze\_s*(/ skipwhite skipempty nextgroup=jsFuncArgs
+syntax match jsFunctionKey contained /\<\K\k*\ze\s*:\s*function\>/
+syntax match jsObjectMethodType contained /\<[gs]et\ze\s\+\K\k*/ skipwhite skipempty nextgroup=jsObjectFuncName
+syntax region jsObjectStringKey contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '').' skipwhite skipempty nextgroup=@jsExpression'
@@ -101,8 +94,8 @@ exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal
exe 'syntax keyword jsSuper super contained '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '')
" Statement Keywords
-syntax match jsBlockLabel /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\s*::\@!/ contains=jsNoise skipwhite skipempty nextgroup=jsBlock
-syntax match jsBlockLabelKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\%(\s*\%(;\|\n\)\)\@=/
+syntax match jsBlockLabel /\<\K\k*\s*::\@!/ contains=jsNoise skipwhite skipempty nextgroup=jsBlock
+syntax match jsBlockLabelKey contained /\<\K\k*\ze\s*\_[;]/
syntax keyword jsStatement contained with yield debugger
syntax keyword jsStatement contained break continue skipwhite skipempty nextgroup=jsBlockLabelKey
syntax keyword jsConditional if skipwhite skipempty nextgroup=jsParenIfElse
@@ -119,7 +112,7 @@ syntax keyword jsAsyncKeyword async await
syntax match jsSwitchColon contained /::\@!/ skipwhite skipempty nextgroup=jsSwitchBlock
" Keywords
-syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat fetch
+syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set WeakSet RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat fetch
syntax keyword jsGlobalNodeObjects module exports global process __dirname __filename
syntax match jsGlobalNodeObjects /\<require\>/ containedin=jsFuncCall
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
@@ -164,68 +157,68 @@ syntax region jsBlock matchgroup=jsBraces s
syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment,jsFlowTypeKeyword skipwhite skipempty nextgroup=jsFrom fold
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
-syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression
+syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|}\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression
+syntax match jsOperator /?\.\ze\_D/
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs,jsFlowFunctionGroup
-syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowFunctionGroup
+syntax match jsFuncName contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowFunctionGroup
syntax region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend
syntax match jsFuncArgCommas contained ','
syntax keyword jsArguments contained arguments
syntax keyword jsForAwait contained await skipwhite skipempty nextgroup=jsParenRepeat
" Matches a single keyword argument with no parens
-syntax match jsArrowFuncArgs /\k\+\s*\%(=>\)\@=/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend
+syntax match jsArrowFuncArgs /\<\K\k*\ze\s*=>/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend
" Matches a series of arguments surrounded in parens
-syntax match jsArrowFuncArgs /([^()]*)\s*\(=>\)\@=/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend
+syntax match jsArrowFuncArgs /([^()]*)\ze\s*=>/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend
exe 'syntax match jsFunction /\<function\>/ skipwhite skipempty nextgroup=jsGenerator,jsFuncName,jsFuncArgs,jsFlowFunctionGroup skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock,jsCommentFunction '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '')
-exe 'syntax match jsArrowFunction /()\s*\(=>\)\@=/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_noarg_arrow_function') ? 'conceal cchar='.g:javascript_conceal_noarg_arrow_function : '').(' contains=jsArrowFuncArgs')
-exe 'syntax match jsArrowFunction /_\s*\(=>\)\@=/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_function : '')
+exe 'syntax match jsArrowFunction /()\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_noarg_arrow_function') ? 'conceal cchar='.g:javascript_conceal_noarg_arrow_function : '')
+exe 'syntax match jsArrowFunction /_\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_function : '')
" Classes
syntax keyword jsClassKeyword contained class
syntax keyword jsExtendsKeyword contained extends skipwhite skipempty nextgroup=@jsExpression
syntax match jsClassNoise contained /\./
-syntax match jsClassMethodType contained /\%(get\|set\|static\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsAsyncKeyword,jsFuncName,jsClassProperty
+syntax match jsClassMethodType contained /\<\%([gs]et\|static\)\ze\s\+\K\k*/ skipwhite skipempty nextgroup=jsAsyncKeyword,jsFuncName,jsClassProperty
syntax region jsClassDefinition start=/\<class\>/ end=/\(\<extends\>\s\+\)\@<!{\@=/ contains=jsClassKeyword,jsExtendsKeyword,jsClassNoise,@jsExpression,jsFlowClassGroup skipwhite skipempty nextgroup=jsCommentClass,jsClassBlock,jsFlowClassGroup
-syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*[=:]\)\@=/ skipwhite skipempty nextgroup=jsClassValue,jsFlowClassDef
-syntax region jsClassValue contained start=/=/ end=/\%(;\|}\|\n\)\@=/ contains=@jsExpression
+syntax match jsClassProperty contained /\<\K\k*\ze\s*=/ skipwhite skipempty nextgroup=jsClassValue,jsFlowClassDef
+syntax region jsClassValue contained start=/=/ end=/\_[;}]\@=/ contains=@jsExpression
syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs,jsClassValue extend
-syntax match jsClassFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\%(\s*(\)\@=/ skipwhite skipempty nextgroup=jsFuncArgs
-syntax region jsClassStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
-syntax region jsClassStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
+syntax match jsClassFuncName contained /\<\K\k*\ze\s*(/ skipwhite skipempty nextgroup=jsFuncArgs
+syntax region jsClassStringKey contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
" Destructuring
-syntax match jsDestructuringPropertyValue contained /\<[0-9a-zA-Z_$]*\>/
-syntax match jsDestructuringProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValue
-syntax match jsDestructuringAssignment contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValueAssignment
+syntax match jsDestructuringPropertyValue contained /\k\+/
+syntax match jsDestructuringProperty contained /\k\+\ze\s*=/ skipwhite skipempty nextgroup=jsDestructuringValue
+syntax match jsDestructuringAssignment contained /\k\+\ze\s*:/ skipwhite skipempty nextgroup=jsDestructuringValueAssignment
syntax region jsDestructuringValue contained start=/=/ end=/[,}\]]\@=/ contains=@jsExpression extend
syntax region jsDestructuringValueAssignment contained start=/:/ end=/[,}=]\@=/ contains=jsDestructuringPropertyValue,jsDestructuringBlock,jsNoise,jsDestructuringNoise skipwhite skipempty nextgroup=jsDestructuringValue extend
-syntax match jsDestructuringNoise contained /[,\[\]]/
+syntax match jsDestructuringNoise contained /[,[\]]/
syntax region jsDestructuringPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringNoise extend fold
" Comments
syntax keyword jsCommentTodo contained TODO FIXME XXX TBD
-syntax region jsComment start=/\/\// end=/$/ contains=jsCommentTodo,@Spell extend keepend
-syntax region jsComment start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell fold extend keepend
+syntax region jsComment start=+//+ end=/$/ contains=jsCommentTodo,@Spell extend keepend
+syntax region jsComment start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell fold extend keepend
syntax region jsEnvComment start=/\%^#!/ end=/$/ display
" Specialized Comments - These are special comment regexes that are used in
" odd places that maintain the proper nextgroup functionality. It sucks we
" can't make jsComment a skippable type of group for nextgroup
-syntax region jsCommentFunction contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn extend keepend
-syntax region jsCommentFunction contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn fold extend keepend
-syntax region jsCommentClass contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup extend keepend
-syntax region jsCommentClass contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup fold extend keepend
-syntax region jsCommentIfElse contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock extend keepend
-syntax region jsCommentIfElse contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock fold extend keepend
-syntax region jsCommentRepeat contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock extend keepend
-syntax region jsCommentRepeat contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock fold extend keepend
+syntax region jsCommentFunction contained start=+//+ end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn extend keepend
+syntax region jsCommentFunction contained start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn fold extend keepend
+syntax region jsCommentClass contained start=+//+ end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup extend keepend
+syntax region jsCommentClass contained start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup fold extend keepend
+syntax region jsCommentIfElse contained start=+//+ end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock extend keepend
+syntax region jsCommentIfElse contained start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock fold extend keepend
+syntax region jsCommentRepeat contained start=+//+ end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock extend keepend
+syntax region jsCommentRepeat contained start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock fold extend keepend
" Decorators
syntax match jsDecorator /^\s*@/ nextgroup=jsDecoratorFunction
-syntax match jsDecoratorFunction contained /[a-zA-Z_][a-zA-Z0-9_.]*/ nextgroup=jsParenDecorator
+syntax match jsDecoratorFunction contained /\h[a-zA-Z0-9_.]*/ nextgroup=jsParenDecorator
if exists("javascript_plugin_jsdoc")
runtime extras/jsdoc.vim
diff --git a/syntax/mason.vim b/syntax/mason.vim
index a7b2119a..8b8dc4d4 100644
--- a/syntax/mason.vim
+++ b/syntax/mason.vim
@@ -13,12 +13,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
" - 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
@@ -30,26 +26,16 @@ endif
" First pull in the HTML syntax.
"
-if version < 600
- so <sfile>: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 <sfile>:p:h/perl.vim
- unlet b:current_syntax
- syn include @podTop <sfile>: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
@@ -88,21 +74,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 <args>
- else
- com -nargs=+ HiLink hi def link <args>
- 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/nim.vim b/syntax/nim.vim
index fcf06273..8b156c28 100644
--- a/syntax/nim.vim
+++ b/syntax/nim.vim
@@ -92,32 +92,33 @@ endif
if nim_highlight_builtins == 1
" builtin functions, types and objects, not really part of the syntax
- syn keyword nimBuiltin int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64 bool
- syn keyword nimBuiltin char string cstring pointer range array openarray seq
+ syn keyword nimBuiltin int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64
+ syn keyword nimBuiltin bool void chr char string cstring pointer range array openarray openArray seq varargs varArgs
syn keyword nimBuiltin set Byte Natural Positive Conversion
syn keyword nimBuiltin BiggestInt BiggestFloat cchar cschar cshort cint csize cuchar cushort
syn keyword nimBuiltin clong clonglong cfloat cdouble clongdouble cuint culong culonglong cchar
- syn keyword nimBuiltin CompileDate CompileTime nimVersion nimMajor
- syn keyword nimBuiltin nimMinor nimPatch cpuEndian hostOS hostCPU inf
- syn keyword nimBuiltin neginf nan QuitSuccess QuitFailure dbgLineHook stdin
+ syn keyword nimBuiltin CompileDate CompileTime nimversion nimVersion nimmajor nimMajor
+ syn keyword nimBuiltin nimminor nimMinor nimpatch nimPatch cpuendian cpuEndian hostos hostOS hostcpu hostCPU inf
+ syn keyword nimBuiltin neginf nan QuitSuccess QuitFailure dbglinehook dbgLineHook stdin
syn keyword nimBuiltin stdout stderr defined new high low sizeof succ pred
- syn keyword nimBuiltin inc dec newSeq len incl excl card ord chr ze ze64
- syn keyword nimBuiltin toU8 toU16 toU32 abs min max add repr
+ syn keyword nimBuiltin inc dec newseq newSeq len incl excl card ord chr ze ze64
+ syn keyword nimBuiltin tou8 toU8 tou16 toU16 tou32 toU32 abs min max add repr
syn match nimBuiltin "\<contains\>"
- syn keyword nimBuiltin toFloat toBiggestFloat toInt toBiggestInt addQuitProc
- syn keyword nimBuiltin copy setLen newString zeroMem copyMem moveMem
- syn keyword nimBuiltin equalMem alloc alloc0 realloc dealloc setLen assert
- syn keyword nimBuiltin swap getRefcount getCurrentException Msg
- syn keyword nimBuiltin getOccupiedMem getFreeMem getTotalMem isNil seqToPtr
+ syn keyword nimBuiltin tofloat toFloat tobiggestfloat toBiggestFloat toint toInt tobiggestint toBiggestInt
+ syn keyword nimBuiltin addquitproc addQuitProc
+ syn keyword nimBuiltin copy setlen setLen newstring newString zeromem zeroMem copymem copyMem movemem moveMem
+ syn keyword nimBuiltin equalmem equalMem alloc alloc0 realloc dealloc assert
+ syn keyword nimBuiltin echo swap getrefcount getRefcount getcurrentexception getCurrentException Msg
+ syn keyword nimBuiltin getoccupiedmem getOccupiedMem getfreemem getFreeMem gettotalmem getTotalMem isnil isNil seqtoptr seqToPtr
syn keyword nimBuiltin find pop GC_disable GC_enable GC_fullCollect
syn keyword nimBuiltin GC_setStrategy GC_enableMarkAndSweep GC_Strategy
syn keyword nimBuiltin GC_disableMarkAnd Sweep GC_getStatistics GC_ref
syn keyword nimBuiltin GC_ref GC_ref GC_unref GC_unref GC_unref quit
syn keyword nimBuiltin OpenFile OpenFile CloseFile EndOfFile readChar
- syn keyword nimBuiltin FlushFile readFile write readLine writeln writeln
- syn keyword nimBuiltin getFileSize ReadBytes ReadChars readBuffer writeBytes
- syn keyword nimBuiltin writeChars writeBuffer setFilePos getFilePos
- syn keyword nimBuiltin fileHandle countdown countup items lines
+ syn keyword nimBuiltin FlushFile readfile readFile readline readLine write writeln writeLn writeline writeLine
+ syn keyword nimBuiltin getfilesize getFileSize ReadBytes ReadChars readbuffer readBuffer writebytes writeBytes
+ syn keyword nimBuiltin writechars writeChars writebuffer writeBuffer setfilepos setFilePos getfilepos getFilePos
+ syn keyword nimBuiltin filehandle fileHandle countdown countup items lines
syn keyword nimBuiltin FileMode File RootObj FileHandle ByteAddress Endianness
endif
diff --git a/syntax/perl.vim b/syntax/perl.vim
index b2534370..a61a6486 100644
--- a/syntax/perl.vim
+++ b/syntax/perl.vim
@@ -435,125 +435,121 @@ else
syn sync minlines=0
endif
-command -nargs=+ HiLink hi def link <args>
-
" 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/php.vim b/syntax/php.vim
index c8e6f3c6..e05e1eed 100644
--- a/syntax/php.vim
+++ b/syntax/php.vim
@@ -621,7 +621,7 @@ if !exists("php_ignore_phpdoc") || !php_ignore_phpdoc
syn region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpDocComment
syn match phpDocTags "@\%(abstract\|access\|api\|author\|brief\|bug\|category\|class\|copyright\|created\|date\|deprecated\|details\|example\|exception\|file\|filesource\|final\|global\|id\|ignore\|inheritdoc\|internal\|license\|link\|magic\|method\|name\|package\|param\|property\|return\|see\|since\|source\|static\|staticvar\|struct\|subpackage\|throws\|toc\|todo\|tutorial\|type\|uses\|var\|version\|warning\)" containedin=phpDocComment nextgroup=phpDocParam,phpDocIdentifier skipwhite contained
- syn match phpDocParam "\s\+\zs\%(\h\w*|\?\)\+" nextgroup=phpDocIdentifier skipwhite contained
+ syn match phpDocParam "\s\+\zs\(|\|\\\|\h\w*\)*\h\w*" nextgroup=phpDocIdentifier skipwhite contained
syn match phpDocIdentifier "\s\+\zs$\h\w*" contained
syn case match
diff --git a/syntax/pod.vim b/syntax/pod.vim
index c337de8f..7ea78860 100644
--- a/syntax/pod.vim
+++ b/syntax/pod.vim
@@ -21,11 +21,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
" 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
@@ -69,28 +66,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 <args>
- else
- command -nargs=+ HiLink hi def link <args>
- 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/purescript.vim b/syntax/purescript.vim
index 39ad579f..50e35395 100644
--- a/syntax/purescript.vim
+++ b/syntax/purescript.vim
@@ -21,13 +21,13 @@ syn keyword purescriptBoolean true false
syn match purescriptDelimiter "[,;|.()[\]{}]"
" Constructor
-syn match purescriptConstructor "\<[A-Z]\w*\>"
+syn match purescriptConstructor "\%(\<class\s\+\)\@15<!\<[A-Z]\w*\>"
syn region purescriptConstructorDecl matchgroup=purescriptConstructor start="\<[A-Z]\w*\>" end="\(|\|$\)"me=e-1,re=e-1 contained
\ containedin=purescriptData,purescriptNewtype
\ contains=purescriptType,purescriptTypeVar,purescriptDelimiter,purescriptOperatorType,purescriptOperatorTypeSig,@purescriptComment
" Type
-syn match purescriptType "\<[A-Z]\w*\>" contained
+syn match purescriptType "\%(\<class\s\+\)\@15<!\<[A-Z]\w*\>" contained
\ containedin=purescriptTypeAlias
\ nextgroup=purescriptType,purescriptTypeVar skipwhite
syn match purescriptTypeVar "\<[_a-z]\(\w\|\'\)*\>" contained
@@ -36,9 +36,20 @@ syn region purescriptTypeExport matchgroup=purescriptType start="\<[A-Z]\(\S\&[^
\ contains=purescriptConstructor,purescriptDelimiter
" Function
-syn match purescriptFunction "\<[_a-z]\(\w\|\'\)*\>" contained
-syn match purescriptFunction "(\(\W\&[^(),\"]\)\+)" contained extend
-syn match purescriptBacktick "`[_A-Za-z][A-Za-z0-9_]*`"
+syn match purescriptFunction "\%(\<instance\s\+\|\<class\s\+\)\@18<!\<[_a-z]\(\w\|\'\)*\>" contained
+" syn match purescriptFunction "\<[_a-z]\(\w\|\'\)*\>" contained
+syn match purescriptFunction "(\%(\<class\s\+\)\@18<!\(\W\&[^(),\"]\)\+)" contained extend
+syn match purescriptBacktick "`[_A-Za-z][A-Za-z0-9_\.]*`"
+
+" Class
+syn region purescriptClassDecl start="^\%(\s*\)class\>"ms=e-5 end="\<where\>\|$"
+ \ contains=purescriptClass,purescriptClassName,purescriptOperatorType,purescriptOperator,purescriptType,purescriptWhere
+ \ nextgroup=purescriptClass
+ \ skipnl
+syn match purescriptClass "\<class\>" containedin=purescriptClassDecl contained
+ \ nextgroup=purescriptClassName
+ \ skipnl
+syn match purescriptClassName "\<[A-Z]\w*\>" containedin=purescriptClassDecl contained
" Module
syn match purescriptModuleName "\(\w\+\.\?\)*" contained excludenl
@@ -46,8 +57,8 @@ syn match purescriptModuleKeyword "\<module\>"
syn match purescriptModule "^module\>\s\+\<\(\w\+\.\?\)*\>"
\ contains=purescriptModuleKeyword,purescriptModuleName
\ nextgroup=purescriptModuleParams skipwhite skipnl skipempty
-syn region purescriptModuleParams start="(" end=")" fold contained keepend
- \ contains=purescriptDelimiter,purescriptType,purescriptTypeExport,purescriptFunction,purescriptStructure,purescriptModuleKeyword,@purescriptComment
+syn region purescriptModuleParams start="(" skip="([^)]\{-})" end=")" fold contained keepend
+ \ contains=purescriptClassDecl,purescriptClass,purescriptClassName,purescriptDelimiter,purescriptType,purescriptTypeExport,purescriptFunction,purescriptStructure,purescriptModuleKeyword,@purescriptComment
\ nextgroup=purescriptImportParams skipwhite
" Import
@@ -86,8 +97,9 @@ syn match purescriptForall "∀"
syn keyword purescriptConditional if then else
syn keyword purescriptStatement do case of in
syn keyword purescriptLet let
+" syn keyword purescriptClass class
syn keyword purescriptWhere where
-syn match purescriptStructure "\<\(data\|newtype\|type\|class\|kind\)\>"
+syn match purescriptStructure "\<\(data\|newtype\|type\|kind\)\>"
\ nextgroup=purescriptType skipwhite
syn keyword purescriptStructure derive
syn keyword purescriptStructure instance
@@ -101,7 +113,7 @@ syn match purescriptInfix "^\(infix\|infixl\|infixr\)\>\s\+\([0-9]\+\)\s\+\(type
" Operators
syn match purescriptOperator "\([-!#$%&\*\+/<=>\?@\\^|~:]\|\<_\>\)"
-syn match purescriptOperatorType "\(::\|∷\)"
+syn match purescriptOperatorType "\%(\<instance\>.*\)\@40<!\(::\|∷\)"
\ nextgroup=purescriptForall,purescriptType skipwhite skipnl skipempty
syn match purescriptOperatorFunction "\(->\|<-\|[\\→←]\)"
syn match purescriptOperatorTypeSig "\(->\|<-\|=>\|<=\|::\|[∷∀→←⇒⇐]\)" contained
@@ -176,6 +188,8 @@ highlight def link purescriptLineComment purescriptComment
highlight def link purescriptBlockComment purescriptComment
" purescript general highlights
+highlight def link purescriptClass purescriptKeyword
+highlight def link purescriptClassName Type
highlight def link purescriptStructure purescriptKeyword
highlight def link purescriptKeyword Keyword
highlight def link purescriptStatement Statement
diff --git a/syntax/qml.vim b/syntax/qml.vim
index f90791f3..2fef61ee 100644
--- a/syntax/qml.vim
+++ b/syntax/qml.vim
@@ -2,11 +2,14 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
" Vim syntax file
" Language: QML
-" Maintainer: Warwick Allison <warwick.allison@nokia.com>
-" Updaters:
-" URL:
-" Changes:
-" Last Change: 2009 Apr 30
+" Maintainer: Peter Hoeg <peter@hoeg.com>
+" Updaters: Refer to CONTRIBUTORS.md
+" URL: https://github.com/peterhoeg/vim-qml
+" Changes: `git log` is your friend
+" Last Change: 2017-11-11
+"
+" This file is bassed on the original work done by Warwick Allison
+" <warwick.allison@nokia.com> whose did about 99% of the work here.
" Based on javascript syntax (as is QML)
@@ -26,20 +29,20 @@ endif
syn case ignore
-
+syn cluster qmlExpr contains=qmlStringD,qmlString,SqmlCharacter,qmlNumber,qmlObjectLiteralType,qmlBoolean,qmlType,qmlJsType,qmlNull,qmlGlobal,qmlFunction
syn keyword qmlCommentTodo TODO FIXME XXX TBD contained
syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo
syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
syn region qmlComment start="/\*" end="\*/" contains=@Spell,qmlCommentTodo fold
syn match qmlSpecial "\\\d\d\d\|\\."
-syn region qmlStringD start=+"+ skip=+\\\\\|\\"\|\\$+ end=+"\|$+ contains=qmlSpecial,@htmlPreproc
-syn region qmlStringS start=+'+ skip=+\\\\\|\\'\|\\$+ end=+'\|$+ contains=qmlSpecial,@htmlPreproc
+syn region qmlStringD start=+"+ skip=+\\\\\|\\"\|\\$+ end=+"\|$+ contains=qmlSpecial,@htmlPreproc,@Spell
+syn region qmlStringS start=+'+ skip=+\\\\\|\\'\|\\$+ end=+'\|$+ contains=qmlSpecial,@htmlPreproc,@Spell
syn match qmlCharacter "'\\.'"
syn match qmlNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
syn region qmlRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
syn match qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@="
-syn match qmlNonBindingColon "?[^;]*:"
+syn region qmlTernaryColon start="?" end=":" contains=@qmlExpr,qmlBraces,qmlParens
syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:"
syn keyword qmlConditional if else switch
@@ -122,7 +125,6 @@ if version >= 508 || !exists("did_qml_syn_inits")
HiLink qmlReserved Keyword
HiLink qmlDebug Debug
HiLink qmlConstant Label
- HiLink qmlNonBindingColon NONE
HiLink qmlBindingProperty Label
HiLink qmlDeclaration Function
diff --git a/syntax/scala.vim b/syntax/scala.vim
index 5e12b999..f551f37d 100644
--- a/syntax/scala.vim
+++ b/syntax/scala.vim
@@ -102,9 +102,9 @@ syn match scalaTypeTypeDeclaration /(/ contained nextgroup=scalaTypeTypeExtensio
syn match scalaTypeTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeTypeDeclaration contains=scalaTypeTypeExtension skipwhite
syn match scalaTypeTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals skipwhite
syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
-syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeTypeDeclaration skipwhite
+syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeTypeDeclaration skipwhite
syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite
-syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
+syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeTypePostDeclaration skipwhite
hi link scalaTypeTypeDeclaration Type
hi link scalaTypeTypeExtension Keyword
hi link scalaTypeTypePostDeclaration Special
@@ -113,7 +113,7 @@ hi link scalaTypeTypePostExtension Keyword
syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite
syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite
syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite
-syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeDeclaration skipwhite
+syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeDeclaration skipwhite
hi link scalaTypeDeclaration Type
hi link scalaTypeExtension Keyword
hi link scalaTypePostExtension Keyword
@@ -122,12 +122,14 @@ syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$\s]:\_s*\)\ze[_=(\.A-Za-z0-9$]\+/
syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration
hi link scalaTypeAnnotation Normal
-syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained
-syn match scalaCaseFollowing /`[^`]\+`/ contained
+syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained contains=scalaCapitalWord
+syn match scalaCaseFollowing /`[^`]\+`/ contained contains=scalaCapitalWord
hi link scalaCaseFollowing Special
-syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super
+syn keyword scalaKeywordModifier abstract override final lazy implicit private protected sealed null super
+syn keyword scalaSpecialFunction implicitly require
hi link scalaKeywordModifier Function
+hi link scalaSpecialFunction Function
syn keyword scalaSpecial this true false ne eq
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
@@ -199,7 +201,6 @@ hi link scalaDocLinks Function
hi link scalaParameterAnnotation Function
hi link scalaParamAnnotationValue Keyword
hi link scalaCommentAnnotation Function
-hi link scalaCommentCodeBlockBrackets String
hi link scalaCommentCodeBlock String
hi link scalaTodo Todo
diff --git a/syntax/toml.vim b/syntax/toml.vim
index 82338428..17ea3cf9 100644
--- a/syntax/toml.vim
+++ b/syntax/toml.vim
@@ -41,10 +41,16 @@ hi def link tomlBoolean Boolean
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)/ display
hi def link tomlDate Constant
-syn match tomlTable /^\s*\[[^#\[\]]\+\]\s*\(#.*\)\?$/ contains=tomlComment
+syn region tomlKeyDq oneline start=/"/ end=/"/ contains=tomlEscape contained
+hi def link tomlKeyDq Identifier
+
+syn region tomlKeySq oneline start=/'/ end=/'/ contained
+hi def link tomlKeySq Identifier
+
+syn region tomlTable oneline start=/^\s*\[[^\[]/ end=/\]/ contains=tomlKeyDq,tomlKeySq
hi def link tomlTable Identifier
-syn match tomlTableArray /^\s*\[\[[^#\[\]]\+\]\]\s*\(#.*\)\?$/ contains=tomlComment
+syn region tomlTableArray oneline start=/^\s*\[\[/ end=/\]\]/ contains=tomlKeyDq,tomlKeySq
hi def link tomlTableArray Identifier
syn keyword tomlTodo TODO FIXME XXX BUG contained
diff --git a/syntax/twig.vim b/syntax/twig.vim
index 5fe20d7d..3388f3b2 100644
--- a/syntax/twig.vim
+++ b/syntax/twig.vim
@@ -19,9 +19,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'twig') == -1
" 2011 July 27: Changed all references of jinja tp twig
" 2014 December 4: Do not assume that the base filetype is HTML.
-if exists('b:main_syntax')
- finish
-endif
if exists('b:current_syntax')
let b:main_syntax = b:current_syntax
else
diff --git a/syntax/xs.vim b/syntax/xs.vim
index 459a620e..82fd1a33 100644
--- a/syntax/xs.vim
+++ b/syntax/xs.vim
@@ -7,20 +7,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
" Previous: Vincent Pit <perl@profvince.com>
" 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 <sfile>: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)
@@ -3672,29 +3663,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 <args>
- else
- command -nargs=+ HiLink hi def link <args>
- 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"