summaryrefslogtreecommitdiffstats
path: root/runtime/syntax
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-18 13:04:22 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-18 13:04:22 +0100
commit9712ff1288f942736ed76c0dec014909f067eec9 (patch)
treed3db95b26eb5606d89a711571055ceceee7c52e3 /runtime/syntax
parent65ee49decf5677690cd695d5d288e39344965fff (diff)
Update runtime files
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/gdscript.vim12
-rw-r--r--runtime/syntax/lua.vim265
-rw-r--r--runtime/syntax/lyrics.vim43
-rw-r--r--runtime/syntax/srt.vim62
-rw-r--r--runtime/syntax/vdf.vim54
-rw-r--r--runtime/syntax/vim.vim44
6 files changed, 357 insertions, 123 deletions
diff --git a/runtime/syntax/gdscript.vim b/runtime/syntax/gdscript.vim
index e9295a411d..48af153513 100644
--- a/runtime/syntax/gdscript.vim
+++ b/runtime/syntax/gdscript.vim
@@ -18,8 +18,6 @@ syn keyword gdscriptRepeat for while break continue
syn keyword gdscriptOperator is as not and or in
-syn match gdscriptClass "\v<\u\w+>"
-syn match gdscriptConstant "\<[_A-Z]\+[0-9_A-Z]*\>"
syn match gdscriptBlockStart ":\s*$"
syn keyword gdscriptKeyword null self owner parent tool
@@ -33,14 +31,16 @@ syn keyword gdscriptStatement onready
syn keyword gdscriptStatement class_name extends
syn keyword gdscriptType void bool int float String contained
+syn match gdscriptType ":\s*\zs\h\w*" contained
+syn match gdscriptType "->\s*\zs\h\w*" contained
syn keyword gdscriptStatement var nextgroup=gdscriptTypeDecl skipwhite
syn keyword gdscriptStatement const nextgroup=gdscriptTypeDecl skipwhite
-syn match gdscriptTypeDecl "\h\w*\s*:\s*\h\w*" contains=gdscriptOperator,gdscriptType,gdscriptClass contained skipwhite
-syn match gdscriptTypeDecl "->\s*\h\w*" contains=gdscriptOperator,gdscriptType,gdscriptClass skipwhite
+syn match gdscriptTypeDecl "\h\w*\s*:\s*\h\w*" contains=gdscriptType contained skipwhite
+syn match gdscriptTypeDecl "->\s*\h\w*" contains=gdscriptType skipwhite
syn keyword gdscriptStatement export nextgroup=gdscriptExportTypeDecl skipwhite
-syn match gdscriptExportTypeDecl "(.\{-}[,)]" contains=gdscriptOperator,gdscriptType,gdscriptClass contained skipwhite
+syn match gdscriptExportTypeDecl "(.\{-}[,)]" contains=gdscriptOperator,gdscriptType contained skipwhite
syn keyword gdscriptStatement setget nextgroup=gdscriptSetGet,gdscriptSetGetSeparator skipwhite
syn match gdscriptSetGet "\h\w*" nextgroup=gdscriptSetGetSeparator display contained skipwhite
@@ -84,8 +84,6 @@ hi def link gdscriptOperator Operator
hi def link gdscriptRepeat Repeat
hi def link gdscriptSetGet Function
hi def link gdscriptFunctionName Function
-hi def link gdscriptClass Type
-hi def link gdscriptConstant Constant
hi def link gdscriptBuiltinStruct Typedef
hi def link gdscriptComment Comment
hi def link gdscriptString String
diff --git a/runtime/syntax/lua.vim b/runtime/syntax/lua.vim
index 437a1ff113..9c5a490582 100644
--- a/runtime/syntax/lua.vim
+++ b/runtime/syntax/lua.vim
@@ -1,11 +1,12 @@
" Vim syntax file
-" Language: Lua 4.0, Lua 5.0, Lua 5.1 and Lua 5.2
+" Language: Lua 4.0, Lua 5.0, Lua 5.1, Lua 5.2 and Lua 5.3
" Maintainer: Marcus Aurelius Farias <masserahguard-lua 'at' yahoo com>
" First Author: Carlos Augusto Teixeira Mendes <cmendes 'at' inf puc-rio br>
-" Last Change: 2022 Mar 31
+" Last Change: 2022 Sep 07
" Options: lua_version = 4 or 5
-" lua_subversion = 0 (4.0, 5.0) or 1 (5.1) or 2 (5.2)
-" default 5.2
+" lua_subversion = 0 (for 4.0 or 5.0)
+" or 1, 2, 3 (for 5.1, 5.2 or 5.3)
+" the default is 5.3
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -16,70 +17,78 @@ let s:cpo_save = &cpo
set cpo&vim
if !exists("lua_version")
- " Default is lua 5.2
+ " Default is lua 5.3
let lua_version = 5
- let lua_subversion = 2
+ let lua_subversion = 3
elseif !exists("lua_subversion")
- " lua_version exists, but lua_subversion doesn't. So, set it to 0
+ " lua_version exists, but lua_subversion doesn't. In this case set it to 0
let lua_subversion = 0
endif
syn case match
" syncing method
-syn sync minlines=100
+syn sync minlines=1000
-" Comments
-syn keyword luaTodo contained TODO FIXME XXX
-syn match luaComment "--.*$" contains=luaTodo,@Spell
-if lua_version == 5 && lua_subversion == 0
- syn region luaComment matchgroup=luaCommentDelimiter start="--\[\[" end="\]\]" contains=luaTodo,luaInnerComment,@Spell
- syn region luaInnerComment contained transparent start="\[\[" end="\]\]"
-elseif lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
- " Comments in Lua 5.1: --[[ ... ]], [=[ ... ]=], [===[ ... ]===], etc.
- syn region luaComment matchgroup=luaCommentDelimiter start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaTodo,@Spell
+if lua_version >= 5
+ syn keyword luaMetaMethod __add __sub __mul __div __pow __unm __concat
+ syn keyword luaMetaMethod __eq __lt __le
+ syn keyword luaMetaMethod __index __newindex __call
+ syn keyword luaMetaMethod __metatable __mode __gc __tostring
endif
-" First line may start with #!
-syn match luaComment "\%^#!.*"
+if lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
+ syn keyword luaMetaMethod __mod __len
+endif
+
+if lua_version > 5 || (lua_version == 5 && lua_subversion >= 2)
+ syn keyword luaMetaMethod __pairs
+endif
+
+if lua_version > 5 || (lua_version == 5 && lua_subversion >= 3)
+ syn keyword luaMetaMethod __idiv __name
+ syn keyword luaMetaMethod __band __bor __bxor __bnot __shl __shr
+endif
+
+if lua_version > 5 || (lua_version == 5 && lua_subversion >= 4)
+ syn keyword luaMetaMethod __close
+endif
" catch errors caused by wrong parenthesis and wrong curly brackets or
" keywords placed outside their respective blocks
-syn region luaParen transparent start='(' end=')' contains=ALLBUT,luaParenError,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaBlock,luaLoopBlock,luaIn,luaStatement
-syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=ALLBUT,luaBraceError,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaBlock,luaLoopBlock,luaIn,luaStatement
+syn region luaParen transparent start='(' end=')' contains=TOP,luaParenError
syn match luaParenError ")"
-syn match luaBraceError "}"
+syn match luaError "}"
syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>"
-" function ... end
-syn region luaFunctionBlock transparent matchgroup=luaFunction start="\<function\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn
+" Function declaration
+syn region luaFunctionBlock transparent matchgroup=luaFunction start="\<function\>" end="\<end\>" contains=TOP
-" if ... then
-syn region luaIfThen transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaIn nextgroup=luaThenEnd skipwhite skipempty
+" else
+syn keyword luaCondElse matchgroup=luaCond contained containedin=luaCondEnd else
" then ... end
-syn region luaThenEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaThenEnd,luaIn
+syn region luaCondEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=TOP
" elseif ... then
-syn region luaElseifThen contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn
+syn region luaCondElseif contained containedin=luaCondEnd transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=TOP
-" else
-syn keyword luaElse contained else
+" if ... then
+syn region luaCondStart transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=TOP nextgroup=luaCondEnd skipwhite skipempty
" do ... end
-syn region luaBlock transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn
-
+syn region luaBlock transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=TOP
" repeat ... until
-syn region luaLoopBlock transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn
+syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=TOP
" while ... do
-syn region luaLoopBlock transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaIn nextgroup=luaBlock skipwhite skipempty
+syn region luaWhile transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=TOP nextgroup=luaBlock skipwhite skipempty
" for ... do and for ... in ... do
-syn region luaLoopBlock transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd nextgroup=luaBlock skipwhite skipempty
+syn region luaFor transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=TOP nextgroup=luaBlock skipwhite skipempty
-syn keyword luaIn contained in
+syn keyword luaFor contained containedin=luaFor in
" other keywords
syn keyword luaStatement return local break
@@ -87,24 +96,48 @@ if lua_version > 5 || (lua_version == 5 && lua_subversion >= 2)
syn keyword luaStatement goto
syn match luaLabel "::\I\i*::"
endif
+
+" operators
syn keyword luaOperator and or not
+
+if (lua_version == 5 && lua_subversion >= 3) || lua_version > 5
+ syn match luaSymbolOperator "[#<>=~^&|*/%+-]\|\.\{2,3}"
+elseif lua_version == 5 && (lua_subversion == 1 || lua_subversion == 2)
+ syn match luaSymbolOperator "[#<>=~^*/%+-]\|\.\{2,3}"
+else
+ syn match luaSymbolOperator "[<>=~^*/+-]\|\.\{2,3}"
+endif
+
+" comments
+syn keyword luaTodo contained TODO FIXME XXX
+syn match luaComment "--.*$" contains=luaTodo,@Spell
+if lua_version == 5 && lua_subversion == 0
+ syn region luaComment matchgroup=luaCommentDelimiter start="--\[\[" end="\]\]" contains=luaTodo,luaInnerComment,@Spell
+ syn region luaInnerComment contained transparent start="\[\[" end="\]\]"
+elseif lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
+ " Comments in Lua 5.1: --[[ ... ]], [=[ ... ]=], [===[ ... ]===], etc.
+ syn region luaComment matchgroup=luaCommentDelimiter start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaTodo,@Spell
+endif
+
+" first line may start with #!
+syn match luaComment "\%^#!.*"
+
syn keyword luaConstant nil
if lua_version > 4
syn keyword luaConstant true false
endif
-" Strings
-if lua_version < 5
- syn match luaSpecial contained "\\[\\abfnrtv\'\"]\|\\[[:digit:]]\{,3}"
-elseif lua_version == 5
+" strings
+syn match luaSpecial contained #\\[\\abfnrtv'"[\]]\|\\[[:digit:]]\{,3}#
+if lua_version == 5
if lua_subversion == 0
- syn match luaSpecial contained #\\[\\abfnrtv'"[\]]\|\\[[:digit:]]\{,3}#
syn region luaString2 matchgroup=luaStringDelimiter start=+\[\[+ end=+\]\]+ contains=luaString2,@Spell
else
- if lua_subversion == 1
- syn match luaSpecial contained #\\[\\abfnrtv'"]\|\\[[:digit:]]\{,3}#
- else " Lua 5.2
- syn match luaSpecial contained #\\[\\abfnrtvz'"]\|\\x[[:xdigit:]]\{2}\|\\[[:digit:]]\{,3}#
+ if lua_subversion >= 2
+ syn match luaSpecial contained #\\z\|\\x[[:xdigit:]]\{2}#
+ endif
+ if lua_subversion >= 3
+ syn match luaSpecial contained #\\u{[[:xdigit:]]\+}#
endif
syn region luaString2 matchgroup=luaStringDelimiter start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell
endif
@@ -115,7 +148,7 @@ syn region luaString matchgroup=luaStringDelimiter start=+"+ end=+"+ skip=+\\\\\
" integer number
syn match luaNumber "\<\d\+\>"
" floating point number, with dot, optional exponent
-syn match luaNumber "\<\d\+\.\d*\%([eE][-+]\=\d\+\)\=\>"
+syn match luaNumber "\<\d\+\.\d*\%([eE][-+]\=\d\+\)\="
" floating point number, starting with a dot, optional exponent
syn match luaNumber "\.\d\+\%([eE][-+]\=\d\+\)\=\>"
" floating point number, without dot, with exponent
@@ -130,8 +163,15 @@ if lua_version >= 5
endif
endif
+" tables
+syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=TOP,luaStatement
+
+" methods
+syntax match luaFunc ":\@<=\k\+"
+
+" built-in functions
syn keyword luaFunc assert collectgarbage dofile error next
-syn keyword luaFunc print rawget rawset tonumber tostring type _VERSION
+syn keyword luaFunc print rawget rawset self tonumber tostring type _VERSION
if lua_version == 4
syn keyword luaFunc _ALERT _ERRORMESSAGE gcinfo
@@ -168,30 +208,26 @@ elseif lua_version == 5
syn match luaFunc /\<package\.loaded\>/
syn match luaFunc /\<package\.loadlib\>/
syn match luaFunc /\<package\.path\>/
+ syn match luaFunc /\<package\.preload\>/
if lua_subversion == 1
syn keyword luaFunc getfenv setfenv
syn keyword luaFunc loadstring module unpack
syn match luaFunc /\<package\.loaders\>/
- syn match luaFunc /\<package\.preload\>/
syn match luaFunc /\<package\.seeall\>/
- elseif lua_subversion == 2
+ elseif lua_subversion >= 2
syn keyword luaFunc _ENV rawlen
syn match luaFunc /\<package\.config\>/
syn match luaFunc /\<package\.preload\>/
syn match luaFunc /\<package\.searchers\>/
syn match luaFunc /\<package\.searchpath\>/
- syn match luaFunc /\<bit32\.arshift\>/
- syn match luaFunc /\<bit32\.band\>/
- syn match luaFunc /\<bit32\.bnot\>/
- syn match luaFunc /\<bit32\.bor\>/
- syn match luaFunc /\<bit32\.btest\>/
- syn match luaFunc /\<bit32\.bxor\>/
- syn match luaFunc /\<bit32\.extract\>/
- syn match luaFunc /\<bit32\.lrotate\>/
- syn match luaFunc /\<bit32\.lshift\>/
- syn match luaFunc /\<bit32\.replace\>/
- syn match luaFunc /\<bit32\.rrotate\>/
- syn match luaFunc /\<bit32\.rshift\>/
+ endif
+
+ if lua_subversion >= 3
+ syn match luaFunc /\<coroutine\.isyieldable\>/
+ endif
+ if lua_subversion >= 4
+ syn keyword luaFunc warn
+ syn match luaFunc /\<coroutine\.close\>/
endif
syn match luaFunc /\<coroutine\.running\>/
endif
@@ -200,6 +236,7 @@ elseif lua_version == 5
syn match luaFunc /\<coroutine\.status\>/
syn match luaFunc /\<coroutine\.wrap\>/
syn match luaFunc /\<coroutine\.yield\>/
+
syn match luaFunc /\<string\.byte\>/
syn match luaFunc /\<string\.char\>/
syn match luaFunc /\<string\.dump\>/
@@ -218,6 +255,18 @@ elseif lua_version == 5
syn match luaFunc /\<string\.match\>/
syn match luaFunc /\<string\.reverse\>/
endif
+ if lua_subversion >= 3
+ syn match luaFunc /\<string\.pack\>/
+ syn match luaFunc /\<string\.packsize\>/
+ syn match luaFunc /\<string\.unpack\>/
+ syn match luaFunc /\<utf8\.char\>/
+ syn match luaFunc /\<utf8\.charpattern\>/
+ syn match luaFunc /\<utf8\.codes\>/
+ syn match luaFunc /\<utf8\.codepoint\>/
+ syn match luaFunc /\<utf8\.len\>/
+ syn match luaFunc /\<utf8\.offset\>/
+ endif
+
if lua_subversion == 0
syn match luaFunc /\<table\.getn\>/
syn match luaFunc /\<table\.setn\>/
@@ -225,19 +274,40 @@ elseif lua_version == 5
syn match luaFunc /\<table\.foreachi\>/
elseif lua_subversion == 1
syn match luaFunc /\<table\.maxn\>/
- elseif lua_subversion == 2
+ elseif lua_subversion >= 2
syn match luaFunc /\<table\.pack\>/
syn match luaFunc /\<table\.unpack\>/
+ if lua_subversion >= 3
+ syn match luaFunc /\<table\.move\>/
+ endif
endif
syn match luaFunc /\<table\.concat\>/
- syn match luaFunc /\<table\.sort\>/
syn match luaFunc /\<table\.insert\>/
+ syn match luaFunc /\<table\.sort\>/
syn match luaFunc /\<table\.remove\>/
+
+ if lua_subversion == 2
+ syn match luaFunc /\<bit32\.arshift\>/
+ syn match luaFunc /\<bit32\.band\>/
+ syn match luaFunc /\<bit32\.bnot\>/
+ syn match luaFunc /\<bit32\.bor\>/
+ syn match luaFunc /\<bit32\.btest\>/
+ syn match luaFunc /\<bit32\.bxor\>/
+ syn match luaFunc /\<bit32\.extract\>/
+ syn match luaFunc /\<bit32\.lrotate\>/
+ syn match luaFunc /\<bit32\.lshift\>/
+ syn match luaFunc /\<bit32\.replace\>/
+ syn match luaFunc /\<bit32\.rrotate\>/
+ syn match luaFunc /\<bit32\.rshift\>/
+ endif
+
syn match luaFunc /\<math\.abs\>/
syn match luaFunc /\<math\.acos\>/
syn match luaFunc /\<math\.asin\>/
syn match luaFunc /\<math\.atan\>/
- syn match luaFunc /\<math\.atan2\>/
+ if lua_subversion < 3
+ syn match luaFunc /\<math\.atan2\>/
+ endif
syn match luaFunc /\<math\.ceil\>/
syn match luaFunc /\<math\.sin\>/
syn match luaFunc /\<math\.cos\>/
@@ -251,25 +321,36 @@ elseif lua_version == 5
if lua_subversion == 0
syn match luaFunc /\<math\.mod\>/
syn match luaFunc /\<math\.log10\>/
- else
- if lua_subversion == 1
- syn match luaFunc /\<math\.log10\>/
- endif
+ elseif lua_subversion == 1
+ syn match luaFunc /\<math\.log10\>/
+ endif
+ if lua_subversion >= 1
syn match luaFunc /\<math\.huge\>/
syn match luaFunc /\<math\.fmod\>/
syn match luaFunc /\<math\.modf\>/
- syn match luaFunc /\<math\.cosh\>/
- syn match luaFunc /\<math\.sinh\>/
- syn match luaFunc /\<math\.tanh\>/
+ if lua_subversion == 1 || lua_subversion == 2
+ syn match luaFunc /\<math\.cosh\>/
+ syn match luaFunc /\<math\.sinh\>/
+ syn match luaFunc /\<math\.tanh\>/
+ endif
endif
- syn match luaFunc /\<math\.pow\>/
syn match luaFunc /\<math\.rad\>/
syn match luaFunc /\<math\.sqrt\>/
- syn match luaFunc /\<math\.frexp\>/
- syn match luaFunc /\<math\.ldexp\>/
+ if lua_subversion < 3
+ syn match luaFunc /\<math\.pow\>/
+ syn match luaFunc /\<math\.frexp\>/
+ syn match luaFunc /\<math\.ldexp\>/
+ else
+ syn match luaFunc /\<math\.maxinteger\>/
+ syn match luaFunc /\<math\.mininteger\>/
+ syn match luaFunc /\<math\.tointeger\>/
+ syn match luaFunc /\<math\.type\>/
+ syn match luaFunc /\<math\.ult\>/
+ endif
syn match luaFunc /\<math\.random\>/
syn match luaFunc /\<math\.randomseed\>/
syn match luaFunc /\<math\.pi\>/
+
syn match luaFunc /\<io\.close\>/
syn match luaFunc /\<io\.flush\>/
syn match luaFunc /\<io\.input\>/
@@ -284,6 +365,7 @@ elseif lua_version == 5
syn match luaFunc /\<io\.tmpfile\>/
syn match luaFunc /\<io\.type\>/
syn match luaFunc /\<io\.write\>/
+
syn match luaFunc /\<os\.clock\>/
syn match luaFunc /\<os\.date\>/
syn match luaFunc /\<os\.difftime\>/
@@ -295,6 +377,7 @@ elseif lua_version == 5
syn match luaFunc /\<os\.setlocale\>/
syn match luaFunc /\<os\.time\>/
syn match luaFunc /\<os\.tmpname\>/
+
syn match luaFunc /\<debug\.debug\>/
syn match luaFunc /\<debug\.gethook\>/
syn match luaFunc /\<debug\.getinfo\>/
@@ -307,26 +390,20 @@ elseif lua_version == 5
if lua_subversion == 1
syn match luaFunc /\<debug\.getfenv\>/
syn match luaFunc /\<debug\.setfenv\>/
+ endif
+ if lua_subversion >= 1
syn match luaFunc /\<debug\.getmetatable\>/
syn match luaFunc /\<debug\.setmetatable\>/
syn match luaFunc /\<debug\.getregistry\>/
- elseif lua_subversion == 2
- syn match luaFunc /\<debug\.getmetatable\>/
- syn match luaFunc /\<debug\.setmetatable\>/
- syn match luaFunc /\<debug\.getregistry\>/
- syn match luaFunc /\<debug\.getuservalue\>/
- syn match luaFunc /\<debug\.setuservalue\>/
- syn match luaFunc /\<debug\.upvalueid\>/
- syn match luaFunc /\<debug\.upvaluejoin\>/
- endif
- if lua_subversion >= 3
- "https://www.lua.org/manual/5.3/manual.html#6.5
- syn match luaFunc /\<utf8\.char\>/
- syn match luaFunc /\<utf8\.charpattern\>/
- syn match luaFunc /\<utf8\.codes\>/
- syn match luaFunc /\<utf8\.codepoint\>/
- syn match luaFunc /\<utf8\.len\>/
- syn match luaFunc /\<utf8\.offset\>/
+ if lua_subversion >= 2
+ syn match luaFunc /\<debug\.getuservalue\>/
+ syn match luaFunc /\<debug\.setuservalue\>/
+ syn match luaFunc /\<debug\.upvalueid\>/
+ syn match luaFunc /\<debug\.upvaluejoin\>/
+ endif
+ if lua_subversion >= 4
+ syn match luaFunc /\<debug.setcstacklimit\>/
+ endif
endif
endif
@@ -341,18 +418,18 @@ hi def link luaString2 String
hi def link luaStringDelimiter luaString
hi def link luaNumber Number
hi def link luaOperator Operator
-hi def link luaIn Operator
+hi def link luaSymbolOperator luaOperator
hi def link luaConstant Constant
hi def link luaCond Conditional
-hi def link luaElse Conditional
+hi def link luaCondElse Conditional
hi def link luaFunction Function
+hi def link luaMetaMethod Function
hi def link luaComment Comment
hi def link luaCommentDelimiter luaComment
hi def link luaTodo Todo
hi def link luaTable Structure
hi def link luaError Error
hi def link luaParenError Error
-hi def link luaBraceError Error
hi def link luaSpecial SpecialChar
hi def link luaFunc Identifier
hi def link luaLabel Label
diff --git a/runtime/syntax/lyrics.vim b/runtime/syntax/lyrics.vim
new file mode 100644
index 0000000000..42a288b51b
--- /dev/null
+++ b/runtime/syntax/lyrics.vim
@@ -0,0 +1,43 @@
+" Vim syntax file
+" Language: LyRiCs
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Filenames: *.lrc
+" Last Change: 2022 Sep 18
+
+if exists('b:current_syntax')
+ finish
+endif
+
+let s:cpo_save = &cpoptions
+set cpoptions&vim
+
+syn case ignore
+
+" Errors
+syn match lrcError /^.\+$/
+
+" ID tags
+syn match lrcTag /^\s*\[\a\+:.\+\]\s*$/ contains=lrcTagName,lrcTagValue
+syn match lrcTagName contained nextgroup=lrcTagValue
+ \ /\[\zs\(al\|ar\|au\|by\|encoding\|la\|id\|length\|offset\|re\|ti\|ve\)\ze:/
+syn match lrcTagValue /:\zs.\+\ze\]/ contained
+
+" Lyrics
+syn match lrcLyricTime /^\s*\[\d\d:\d\d\.\d\d\]/
+ \ contains=lrcNumber nextgroup=lrcLyricLine
+syn match lrcLyricLine /.*$/ contained contains=lrcWordTime,@Spell
+syn match lrcWordTime /<\d\d:\d\d\.\d\d>/ contained contains=lrcNumber,@NoSpell
+syn match lrcNumber /[+-]\=\d\+/ contained
+
+hi def link lrcLyricTime Label
+hi def link lrcNumber Number
+hi def link lrcTag PreProc
+hi def link lrcTagName Identifier
+hi def link lrcTagValue String
+hi def link lrcWordTime Special
+hi def link lrcError Error
+
+let b:current_syntax = 'lyrics'
+
+let &cpoptions = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/srt.vim b/runtime/syntax/srt.vim
new file mode 100644
index 0000000000..12fb264d8e
--- /dev/null
+++ b/runtime/syntax/srt.vim
@@ -0,0 +1,62 @@
+" Vim syntax file
+" Language: SubRip
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Filenames: *.srt
+" Last Change: 2022 Sep 12
+
+if exists('b:current_syntax')
+ finish
+endif
+
+syn spell toplevel
+
+syn cluster srtSpecial contains=srtBold,srtItalics,srtStrikethrough,srtUnderline,srtFont,srtTag,srtEscape
+
+" Number
+syn match srtNumber /^\d\+$/ contains=@NoSpell
+
+" Range
+syn match srtRange /\d\d:\d\d:\d\d[,.]\d\d\d --> \d\d:\d\d:\d\d[,.]\d\d\d/ skipwhite contains=srtArrow,srtTime nextgroup=srtCoordinates
+syn match srtArrow /-->/ contained contains=@NoSpell
+syn match srtTime /\d\d:\d\d:\d\d[,.]\d\d\d/ contained contains=@NoSpell
+syn match srtCoordinates /X1:\d\+ X2:\d\+ Y1:\d\+ Y2:\d\+/ contained contains=@NoSpell
+
+" Bold
+syn region srtBold matchgroup=srtFormat start=+<b>+ end=+</b>+ contains=@srtSpecial
+syn region srtBold matchgroup=srtFormat start=+{b}+ end=+{/b}+ contains=@srtSpecial
+
+" Italics
+syn region srtItalics matchgroup=srtFormat start=+<i>+ end=+</i>+ contains=@srtSpecial
+syn region srtItalics matchgroup=srtFormat start=+{i}+ end=+{/i}+ contains=@srtSpecial
+
+" Strikethrough
+syn region srtStrikethrough matchgroup=srtFormat start=+<s>+ end=+</s>+ contains=@srtSpecial
+syn region srtStrikethrough matchgroup=srtFormat start=+{s}+ end=+{/s}+ contains=@srtSpecial
+
+" Underline
+syn region srtUnderline matchgroup=srtFormat start=+<u>+ end=+</u>+ contains=@srtSpecial
+syn region srtUnderline matchgroup=srtFormat start=+{u}+ end=+{/u}+ contains=@srtSpecial
+
+" Font
+syn region srtFont matchgroup=srtFormat start=+<font[^>]\{-}>+ end=+</font>+ contains=@srtSpecial
+
+" ASS tags
+syn match srtTag /{\\[^}]\{1,}}/ contains=@NoSpell
+
+" Special characters
+syn match srtEscape /\\[nNh]/ contains=@NoSpell
+
+hi def link srtArrow Delimiter
+hi def link srtCoordinates Label
+hi def link srtEscape SpecialChar
+hi def link srtFormat Special
+hi def link srtNumber Number
+hi def link srtTag PreProc
+hi def link srtTime String
+
+hi srtBold cterm=bold gui=bold
+hi srtItalics cterm=italic gui=italic
+hi srtStrikethrough cterm=strikethrough gui=strikethrough
+hi srtUnderline cterm=underline gui=underline
+
+let b:current_syntax = 'srt'
diff --git a/runtime/syntax/vdf.vim b/runtime/syntax/vdf.vim
new file mode 100644
index 0000000000..c690b706ea
--- /dev/null
+++ b/runtime/syntax/vdf.vim
@@ -0,0 +1,54 @@
+" Vim syntax file
+" Language: Valve Data Format
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Filenames: *.vdf
+" Last Change: 2022 Sep 15
+
+if exists('b:current_syntax')
+ finish
+endif
+
+let s:cpo_save = &cpoptions
+set cpoptions&vim
+
+" Comment
+syn keyword vdfTodo contained TODO FIXME XXX
+syn match vdfComment +//.*+ contains=vdfTodo
+
+" Macro
+syn match vdfMacro /^\s*#.*/
+
+" Tag
+syn region vdfTag start=/"/ skip=/\\"/ end=/"/
+ \ nextgroup=vdfValue skipwhite oneline
+
+" Section
+syn region vdfSection matchgroup=vdfBrace
+ \ start=/{/ end=/}/ transparent fold
+ \ contains=vdfTag,vdfSection,vdfComment,vdfConditional
+
+" Conditional
+syn match vdfConditional /\[\$\w\{1,1021}\]/ nextgroup=vdfTag
+
+" Value
+syn region vdfValue start=/"/ skip=/\\"/ end=/"/
+ \ oneline contained contains=vdfVariable,vdfNumber,vdfEscape
+syn region vdfVariable start=/%/ skip=/\\%/ end=/%/ oneline contained
+syn match vdfEscape /\\[nt\\"]/ contained
+syn match vdfNumber /"-\?\d\+"/ contained
+
+hi def link vdfBrace Delimiter
+hi def link vdfComment Comment
+hi def link vdfConditional Constant
+hi def link vdfEscape SpecialChar
+hi def link vdfMacro Macro
+hi def link vdfNumber Number
+hi def link vdfTag Keyword
+hi def link vdfTodo Todo
+hi def link vdfValue String
+hi def link vdfVariable Identifier
+
+let b:current_syntax = 'vdf'
+
+let &cpoptions = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index f00e448234..df5c888f26 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Vim 9.0 script
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
-" Last Change: September 09, 2022
-" Version: 9.0-04
+" Last Change: September 14, 2022
+" Version: 9.0-05
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
" Automatically generated keyword lists: {{{1
@@ -30,24 +30,24 @@ syn match vimCommand contained "\<z[-+^.=]\=\>"
syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Until Winbar XMLent XMLns
" vimOptions are caught only when contained in a vimSet {{{2
-syn keyword vimOption contained acd ambw arshape aw backupskip beval bk bri bufhidden cdh ci cinsd cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault gp guifontwide helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemev mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode sj sn spellfile spo st su swf ta taglength tbis termguicolors textmode thesaurusfunc titlestring tpm ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
-syn keyword vimOption contained ai anti asd awa balloondelay bevalterm bkc briopt buflisted cdhome cin cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepformat guiheadroom helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mousemodel msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm showtabline slm so spelllang spr sta sua switchbuf tabline tagrelative tbs termwinkey textwidth tildeop tl tr ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
-syn keyword vimOption contained akm antialias autochdir background ballooneval bex bl brk buftype cdpath cindent cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn grepprg guiligatures hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mousemoveevent mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess shq sm softtabstop spelloptions sps stal suffixes sws tabpagemax tags tc termwinscroll tf timeout tm ts tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
-syn keyword vimOption contained al ar autoindent backspace balloonevalterm bexpr bo browsedir casemap cedit cink clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtl guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname si smartcase sol spellsuggest sr startofline suffixesadd sxe tabstop tagstack tcldll termwinsize tfu timeoutlen to tsl ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
-syn keyword vimOption contained aleph arab autoread backup balloonexpr bg bomb bs cb cf cinkeys cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw gtt guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak sidescroll smartindent sp spf srr statusline sw sxq tag tal tenc termwintype tgc title toolbar tsr ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
-syn keyword vimOption contained allowrevins arabic autoshelldir backupcopy bdir bh breakat bsdir cc cfu cino cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guicursor guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescrolloff smarttab spc spl ss stl swapfile syn tagbsearch tb term terse tgst titlelen toolbariconsize tsrfu ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
-syn keyword vimOption contained altkeymap arabicshape autowrite backupdir bdlay bin breakindent bsk ccv ch cinoptions cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr gli guifont guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag signcolumn smc spell splitbelow ssl stmp swapsync synmaxcol tagcase tbi termbidi textauto thesaurus titleold top ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan xtermcodes
-syn keyword vimOption contained ambiwidth ari autowriteall backupext belloff binary breakindentopt bt cd charconvert cinscopedecls cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd go guifontset helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch siso smd spellcapcheck splitright ssop sts swb syntax tagfunc tbidi termencoding
+syn keyword vimOption contained acd ambw arshape aw backupskip beval bk bri bufhidden cdh ci cinsd cms commentstring conceallevel cpt cscopetagorder csto cursorlineopt dg dir ed enc errorfile fcl fdn ffs fillchars fo foldmarker formatoptions gdefault gp guifontwide helpheight history hlsearch imaf ims includeexpr infercase iskeyword keywordprg laststatus lispwords lrm magic maxfuncdepth menuitems mm modifiable mousemev mps nu opendevice paste pex pmbfn printencoding pt pythonhome quoteescape renderoptions rlc ruf scb scrolloff selectmode shellquote shiftwidth showmode sj sn spellfile splitscroll ssl stmp swapsync synmaxcol tagcase tbi termbidi textauto thesaurusfunc titlestring tpm ttimeoutlen ttyscroll tx undolevels vartabstop vfile virtualedit warn wfh wildchar wim winminheight wmh write
+syn keyword vimOption contained ai anti asd awa balloondelay bevalterm bkc briopt buflisted cdhome cin cinw co compatible confirm crb cscopeverbose csverb cwh dict directory edcompatible encoding errorformat fcs fdo fic fixendofline foldclose foldmethod formatprg gfm grepformat guiheadroom helplang hk ic imak imsearch incsearch insertmode isp km lazyredraw list ls makeef maxmapdepth mfd mmd modified mousemodel msm number operatorfunc pastetoggle pexpr popt printexpr pumheight pythonthreedll rdt report rnu ruler scf scrollopt sessionoptions shellredir shm showtabline slm so spelllang spo ssop sts swb syntax tagfunc tbidi termencoding textmode tildeop tl tr ttm ttytype uc undoreload vb vi visualbell wb wfw wildcharm winaltkeys winminwidth wmnu writeany
+syn keyword vimOption contained akm antialias autochdir background ballooneval bex bl brk buftype cdpath cindent cinwords cocu complete copyindent cryptmethod csl cuc debug dictionary display ef endofline esckeys fdc fdt fileencoding fixeol foldcolumn foldminlines fp gfn grepprg guiligatures hf hkmap icon imc imsf inde is isprint kmp lbr listchars lsp makeencoding maxmem mh mmp more mousemoveevent mzq numberwidth opfunc patchexpr pfn pp printfont pumwidth pythonthreehome re restorescreen ro rulerformat scl scs sft shellslash shortmess shq sm softtabstop spelloptions spr st su swf ta taglength tbis termguicolors textwidth timeout tm ts tty tw udf updatecount vbs viewdir vop wc wh wildignore wincolor winptydll wmw writebackup
+syn keyword vimOption contained al ar autoindent backspace balloonevalterm bexpr bo browsedir casemap cedit cink clipboard cole completefunc cot cscopepathcomp cspc cul deco diff dy efm eol et fde fen fileencodings fk foldenable foldnestmax fs gfs gtl guioptions hh hkmapp iconstring imcmdline imst indentexpr isf joinspaces kp lcs lm luadll makeprg maxmempattern mis mmt mouse mouses mzquantum nuw osfiletype patchmode ph preserveindent printheader pvh pyx readonly revins rop runtimepath scr sect sh shelltemp shortname si smartcase sol spellsuggest sps sta sua switchbuf tabline tagrelative tbs termwinkey tf timeoutlen to tsl ttybuiltin twk udir updatetime vdir viewoptions vsts wcm whichwrap wildignorecase window winwidth wop writedelay
+syn keyword vimOption contained aleph arab autoread backup balloonexpr bg bomb bs cb cf cinkeys cm colorcolumn completeopt cp cscopeprg csprg culopt def diffexpr ea ei ep eventignore fdi fenc fileformat fkmap foldexpr foldopen fsync gfw gtt guipty hi hkp ignorecase imd imstatusfunc indentkeys isfname js langmap linebreak lmap lw mat maxmemtot mkspellmem mod mousef mouseshape mzschemedll odev pa path pheader previewheight printmbcharset pvp pyxversion redrawtime ri rs sb scroll sections shcf shelltype showbreak sidescroll smartindent sp spf spsc stal suffixes sws tabpagemax tags tc termwinscroll tfu title toolbar tsr ttyfast tws ul ur ve vif vts wcr wi wildmenu winfixheight wiv wrap ws
+syn keyword vimOption contained allowrevins arabic autoshelldir backupcopy bdir bh breakat bsdir cc cfu cino cmdheight columns completepopup cpo cscopequickfix csqf cursorbind define diffopt ead ek equalalways ex fdl fencs fileformats flp foldignore foldtext ft ghr guicursor guitablabel hid hl im imdisable imstyle indk isi key langmenu lines lnr lz matchpairs mco ml modeline mousefocus mouset mzschemegcdll oft packpath pdev pi previewpopup printmbfont pvw qe regexpengine rightleft rtp sbo scrollbind secure shell shellxescape showcmd sidescrolloff smarttab spc spl sr startofline suffixesadd sxe tabstop tagstack tcldll termwinsize tgc titlelen toolbariconsize tsrfu ttym twsl undodir ut verbose viminfo wa wd wic wildmode winfixwidth wiw wrapmargin ww
+syn keyword vimOption contained altkeymap arabicshape autowrite backupdir bdlay bin breakindent bsk ccv ch cinoptions cmdwinheight com completeslash cpoptions cscoperelative csre cursorcolumn delcombine digraph eadirection emo equalprg expandtab fdls fex fileignorecase fml foldlevel formatexpr gcr gli guifont guitabtooltip hidden hlg imactivatefunc imi inc inex isident keymap langnoremap linespace loadplugins ma matchtime mef mle modelineexpr mousehide mousetime nf ofu para penc pm previewwindow printoptions pw qftf relativenumber rightleftcmd ru sbr scrollfocus sel shellcmdflag shellxquote showfulltag signcolumn smc spell splitbelow srr statusline sw sxq tag tal tenc termwintype tgst titleold top ttimeout ttymouse twt undofile varsofttabstop verbosefile viminfofile wak weirdinvert wig wildoptions winheight wm wrapscan xtermcodes
+syn keyword vimOption contained ambiwidth ari autowriteall backupext belloff binary breakindentopt bt cd charconvert cinscopedecls cmp comments concealcursor cpp cscopetag cst cursorline dex dip eb emoji errorbells exrc fdm ff filetype fmr foldlevelstart formatlistpat gd go guifontset helpfile highlight hls imactivatekey iminsert include inf isk keymodel langremap lisp lpl macatsui maxcombine menc mls modelines mousem mp nrformats omnifunc paragraphs perldll pmbcs printdevice prompt pythondll quickfixtextfunc remap rl rubydll sc scrolljump selection shellpipe shiftround showmatch siso smd spellcapcheck splitright ss stl swapfile syn tagbsearch tb term terse thesaurus
" vimOptions: These are the turn