diff options
Diffstat (limited to 'runtime/syntax/lua.vim')
-rw-r--r-- | runtime/syntax/lua.vim | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/runtime/syntax/lua.vim b/runtime/syntax/lua.vim index 7d72603bf..c40c6285c 100644 --- a/runtime/syntax/lua.vim +++ b/runtime/syntax/lua.vim @@ -2,7 +2,7 @@ " Language: Lua 4.0, Lua 5.0 and Lua 5.1 " Maintainer: Marcus Aurelius Farias <marcus.cf 'at' bol com br> " First Author: Carlos Augusto Teixeira Mendes <cmendes 'at' inf puc-rio br> -" Last Change: 2006 Apr 21 +" Last Change: 2006 Aug 10 " Options: lua_version = 4 or 5 " lua_subversion = 0 (4.0, 5.0) or 1 (5.1) " default 5.1 @@ -31,13 +31,13 @@ syn sync minlines=100 " Comments syn keyword luaTodo contained TODO FIXME XXX -syn match luaComment "--.*$" contains=luaTodo +syn match luaComment "--.*$" contains=luaTodo,@Spell if lua_version == 5 && lua_subversion == 0 - syn region luaComment matchgroup=luaComment start="--\[\[" end="\]\]" contains=luaTodo,luaInnerComment + syn region luaComment matchgroup=luaComment 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\]" + syn region luaComment matchgroup=luaComment start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaTodo,@Spell endif " First line may start with #! @@ -95,22 +95,27 @@ if lua_version < 5 syn match luaSpecial contained "\\[\\abfnrtv\'\"]\|\\\d\{,3}" elseif lua_version == 5 && lua_subversion == 0 syn match luaSpecial contained "\\[\\abfnrtv\'\"[\]]\|\\\d\{,3}" - syn region luaString2 matchgroup=luaString start=+\[\[+ end=+\]\]+ contains=luaString2 + syn region luaString2 matchgroup=luaString start=+\[\[+ end=+\]\]+ contains=luaString2,@Spell elseif lua_version > 5 || (lua_version == 5 && lua_subversion >= 1) syn match luaSpecial contained "\\[\\abfnrtv\'\"]\|\\\d\{,3}" - syn region luaString2 matchgroup=luaString start="\[\z(=*\)\[" end="\]\z1\]" + syn region luaString2 matchgroup=luaString start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell endif -syn region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecial -syn region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecial +syn region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecial,@Spell +syn region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecial,@Spell " integer number -syn match luaNumber "\<[0-9]\+\>" +syn match luaNumber "\<\d\+\>" " floating point number, with dot, optional exponent -syn match luaFloat "\<[0-9]\+\.[0-9]*\%(e[-+]\=[0-9]\+\)\=\>" +syn match luaFloat "\<\d\+\.\d*\%(e[-+]\=\d\+\)\=\>" " floating point number, starting with a dot, optional exponent -syn match luaFloat "\.[0-9]\+\%(e[-+]\=[0-9]\+\)\=\>" +syn match luaFloat "\.\d\+\%(e[-+]\=\d\+\)\=\>" " floating point number, without dot, with exponent -syn match luaFloat "\<[0-9]\+e[-+]\=[0-9]\+\>" +syn match luaFloat "\<\d\+e[-+]\=\d\+\>" + +" hex numbers +if lua_version > 5 || (lua_version == 5 && lua_subversion >= 1) + syn match luaNumber "\<0x\x\+\>" +endif " tables syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaCondStart,luaBlock,luaRepeatBlock,luaRepeat,luaStatement |