diff options
author | Josh Rahm <rahm@google.com> | 2022-09-12 10:52:49 -0600 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-09-12 10:52:49 -0600 |
commit | 4889fe01b9853cf98363ac226f95b524801ff3cc (patch) | |
tree | 279d43b86561bf1314fdf1cf5c0c9af6aac76b25 /runtime/syntax/lua.vim | |
parent | 8fc6e69877f6c15942b4e8fc6ca471e4221d9bae (diff) | |
parent | fd70e2bff2440181f63fe124738cf2a025d1e6a5 (diff) | |
download | rneovim-4889fe01b9853cf98363ac226f95b524801ff3cc.tar.gz rneovim-4889fe01b9853cf98363ac226f95b524801ff3cc.tar.bz2 rneovim-4889fe01b9853cf98363ac226f95b524801ff3cc.zip |
Merge remote-tracking branch 'upstream/master' into usermarks
Diffstat (limited to 'runtime/syntax/lua.vim')
-rw-r--r-- | runtime/syntax/lua.vim | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/runtime/syntax/lua.vim b/runtime/syntax/lua.vim index b398e2e5c6..437a1ff113 100644 --- a/runtime/syntax/lua.vim +++ b/runtime/syntax/lua.vim @@ -1,11 +1,11 @@ " Vim syntax file -" Language: Lua 4.0, Lua 5.0, Lua 5.1 and Lua 5.2 -" 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 -" Options: lua_version = 4 or 5 -" lua_subversion = 0 (4.0, 5.0) or 1 (5.1) or 2 (5.2) -" default 5.2 +" Language: Lua 4.0, Lua 5.0, Lua 5.1 and Lua 5.2 +" 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 +" Options: lua_version = 4 or 5 +" lua_subversion = 0 (4.0, 5.0) or 1 (5.1) or 2 (5.2) +" default 5.2 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -33,11 +33,11 @@ syn sync minlines=100 syn keyword luaTodo contained TODO FIXME XXX syn match luaComment "--.*$" contains=luaTodo,@Spell if lua_version == 5 && lua_subversion == 0 - syn region luaComment matchgroup=luaComment start="--\[\[" end="\]\]" contains=luaTodo,luaInnerComment,@Spell + 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=luaComment start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaTodo,@Spell + syn region luaComment matchgroup=luaCommentDelimiter start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaTodo,@Spell endif " First line may start with #! @@ -99,18 +99,18 @@ if lua_version < 5 elseif lua_version == 5 if lua_subversion == 0 syn match luaSpecial contained #\\[\\abfnrtv'"[\]]\|\\[[:digit:]]\{,3}# - syn region luaString2 matchgroup=luaString start=+\[\[+ end=+\]\]+ contains=luaString2,@Spell + 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}# endif - syn region luaString2 matchgroup=luaString start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell + syn region luaString2 matchgroup=luaStringDelimiter start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell endif endif -syn region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecial,@Spell -syn region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecial,@Spell +syn region luaString matchgroup=luaStringDelimiter start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecial,@Spell +syn region luaString matchgroup=luaStringDelimiter start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecial,@Spell " integer number syn match luaNumber "\<\d\+\>" @@ -333,27 +333,29 @@ endif " Define the default highlighting. " Only when an item doesn't have highlighting yet -hi def link luaStatement Statement -hi def link luaRepeat Repeat -hi def link luaFor Repeat -hi def link luaString String -hi def link luaString2 String -hi def link luaNumber Number -hi def link luaOperator Operator -hi def link luaIn Operator -hi def link luaConstant Constant -hi def link luaCond Conditional -hi def link luaElse Conditional -hi def link luaFunction Function -hi def link luaComment Comment -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 +hi def link luaStatement Statement +hi def link luaRepeat Repeat +hi def link luaFor Repeat +hi def link luaString String +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 luaConstant Constant +hi def link luaCond Conditional +hi def link luaElse Conditional +hi def link luaFunction 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 let b:current_syntax = "lua" |