comparison runtime/syntax/lua.vim @ 837:6bb1fa855dc9 v7.0e03

updated for version 7.0e03
author vimboss
date Wed, 19 Apr 2006 21:23:36 +0000
parents cc049b00ee70
children 8e5830943bff
comparison
equal deleted inserted replaced
836:5a7843c57316 837:6bb1fa855dc9
1 " Vim syntax file 1 " Vim syntax file
2 " Language: Lua 4.0 and Lua 5.0 2 " Language: Lua 4.0, Lua 5.0 and Lua 5.1
3 " Maintainer: Marcus Aurelius Farias <marcus.cf 'at' bol.com.br> 3 " Maintainer: Marcus Aurelius Farias <marcus.cf 'at' bol.com.br>
4 " First Author: Carlos Augusto Teixeira Mendes <cmendes 'at' inf puc-rio br> 4 " First Author: Carlos Augusto Teixeira Mendes <cmendes 'at' inf puc-rio br>
5 " Last Change: 2004 Aug 29 5 " Last Change: 2006 Apr. 19
6 " Options: lua_version = 4 or 5 [default] 6 " Options: lua_version = 4 or 5
7 " 7 " lua_subversion = 0 (4.0, 5.0) or 1 (5.1)
8 " default 5.1
9
8 " For version 5.x: Clear all syntax items 10 " For version 5.x: Clear all syntax items
9 " For version 6.x: Quit when a syntax file was already loaded 11 " For version 6.x: Quit when a syntax file was already loaded
10 if version < 600 12 if version < 600
11 syntax clear 13 syntax clear
12 elseif exists("b:current_syntax") 14 elseif exists("b:current_syntax")
13 finish 15 finish
14 endif 16 endif
15 17
16 if !exists("lua_version") 18 if !exists("lua_version")
19 " Default is lua 5.1
17 let lua_version = 5 20 let lua_version = 5
21 let lua_subversion = 1
22 elseif !exists("lua_subversion")
23 " lua_version exists, but lua_subversion doesn't. So, set it to 0
24 let lua_subversion = 0
18 endif 25 endif
19 26
20 syn case match 27 syn case match
21 28
29 " syncing method
30 syn sync minlines=100
31
22 " Comments 32 " Comments
23 syn keyword luaTodo contained TODO FIXME XXX 33 syn keyword luaTodo contained TODO FIXME XXX
24 syn match luaComment "--.*$" contains=luaTodo 34 syn match luaComment "--.*$" contains=luaTodo
25 if lua_version > 4 35 if lua_version == 5 && lua_subversion == 0
26 syn region luaComment matchgroup=luaComment start="--\[\[" end="\]\]" contains=luaTodo,luaInnerComment 36 syn region luaComment matchgroup=luaComment start="--\[\[" end="\]\]" contains=luaTodo,luaInnerComment
27 syn region luaInnerComment contained transparent start="\[\[" end="\]\]" 37 syn region luaInnerComment contained transparent start="\[\[" end="\]\]"
28 endif 38 elseif lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
39 " Comments in Lua 5.1: [[ ... ]], [=[ ... ]=], [===[ ... ]===], etc.
40 syn region luaComment matchgroup=luaComment start="--\[\z(=*\)\[" end="\]\z1\]"
41 endif
42
29 " First line may start with #! 43 " First line may start with #!
30 syn match luaComment "\%^#!.*" 44 syn match luaComment "\%^#!.*"
31 45
32 " catch errors caused by wrong parenthesis and wrong curly brackets or 46 " catch errors caused by wrong parenthesis and wrong curly brackets or
33 " keywords placed outside their respective blocks 47 " keywords placed outside their respective blocks
34 48
35 syn region luaParen transparent start='(' end=')' contains=ALLBUT,luaError,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaCondStart,luaBlock,luaRepeatBlock,luaRepeat,luaStatement 49 syn region luaParen transparent start='(' end=')' contains=ALLBUT,luaError,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaCondStart,luaBlock,luaRepeatBlock,luaRepeat,luaStatement
36 syn match luaError ")" 50 syn match luaError ")"
37 syn match luaError "}" 51 syn match luaError "}"
38 syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>" 52 syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>"
39
40 53
41 " Function declaration 54 " Function declaration
42 syn region luaFunctionBlock transparent matchgroup=luaFunction start="\<function\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat 55 syn region luaFunctionBlock transparent matchgroup=luaFunction start="\<function\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat
43 56
44 " if then else elseif end 57 " if then else elseif end
45 syn keyword luaCond contained else 58 syn keyword luaCond contained else
46 59
47 " then ... end 60 " then ... end
48 syn region luaCondEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaRepeat 61 syn region luaCondEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaRepeat
49 62
50 " elseif ... then 63 " elseif ... then
51 syn region luaCondElseif contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat 64 syn region luaCondElseif contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat
52 65
53 " if ... then 66 " if ... then
54 syn region luaCondStart transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat nextgroup=luaCondEnd skipwhite skipempty 67 syn region luaCondStart transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat nextgroup=luaCondEnd skipwhite skipempty
55 68
56 " do ... end 69 " do ... end
57 syn region luaBlock transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat 70 syn region luaBlock transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat
58 71
59 " repeat ... until 72 " repeat ... until
60 syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat 73 syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat
61 74
62 " while ... do 75 " while ... do
63 syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat nextgroup=luaBlock skipwhite skipempty 76 syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat nextgroup=luaBlock skipwhite skipempty
64 77
65 " for ... do and for ... in ... do 78 " for ... do and for ... in ... do
66 syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd nextgroup=luaBlock skipwhite skipempty 79 syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd nextgroup=luaBlock skipwhite skipempty
67 80
68 " Following 'else' example. This is another item to those 81 " Following 'else' example. This is another item to those
69 " contains=ALLBUT,... because only the 'for' luaRepeatBlock contains it. 82 " contains=ALLBUT,... because only the 'for' luaRepeatBlock contains it.
70 syn keyword luaRepeat contained in 83 syn keyword luaRepeat contained in
71 84
72 " other keywords 85 " other keywords
73 syn keyword luaStatement return local break 86 syn keyword luaStatement return local break
74 syn keyword luaOperator and or not 87 syn keyword luaOperator and or not
75 syn keyword luaConstant nil 88 syn keyword luaConstant nil
76 if lua_version > 4 89 if lua_version > 4
77 syn keyword luaConstant true false 90 syn keyword luaConstant true false
78 endif 91 endif
79
80 " Pre processor doesn't exist since Lua 4.0
81 " syn match luaPreProc "^\s*$\%(debug\|nodebug\|if\|ifnot\|end\|else\|endinput\)\>"
82 92
83 " Strings 93 " Strings
84 syn match luaSpecial contained "\\[\\abfnrtv\'\"[\]]\|\\\d\{,3}" 94 syn match luaSpecial contained "\\[\\abfnrtv\'\"[\]]\|\\\d\{,3}"
85 syn region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecial 95 syn region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecial
86 syn region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecial 96 syn region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecial
87 " Nested strings 97 " Nested strings
88 syn region luaString2 matchgroup=luaString start=+\[\[+ end=+\]\]+ contains=luaString2 98 if (lua_version == 5 && lua_subversion == 0) || lua_version < 5
99 syn region luaString2 matchgroup=luaString start=+\[\[+ end=+\]\]+ contains=luaString2
100 elseif lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
101 syn region luaString2 matchgroup=luaString start="\[\z(=*\)\[" end="\]\z1\]"
102 endif
89 103
90 " integer number 104 " integer number
91 syn match luaNumber "\<[0-9]\+\>" 105 syn match luaNumber "\<[0-9]\+\>"
92 " floating point number, with dot, optional exponent 106 " floating point number, with dot, optional exponent
93 syn match luaFloat "\<[0-9]\+\.[0-9]*\%(e[-+]\=[0-9]\+\)\=\>" 107 syn match luaFloat "\<[0-9]\+\.[0-9]*\%(e[-+]\=[0-9]\+\)\=\>"
94 " floating point number, starting with a dot, optional exponent 108 " floating point number, starting with a dot, optional exponent
95 syn match luaFloat "\.[0-9]\+\%(e[-+]\=[0-9]\+\)\=\>" 109 syn match luaFloat "\.[0-9]\+\%(e[-+]\=[0-9]\+\)\=\>"
96 " floating point number, without dot, with exponent 110 " floating point number, without dot, with exponent
97 syn match luaFloat "\<[0-9]\+e[-+]\=[0-9]\+\>" 111 syn match luaFloat "\<[0-9]\+e[-+]\=[0-9]\+\>"
98 112
99 " tables 113 " tables
100 syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaCondStart,luaBlock,luaRepeatBlock,luaRepeat,luaStatement 114 syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaCondStart,luaBlock,luaRepeatBlock,luaRepeat,luaStatement
101 115
102 syn keyword luaFunc assert collectgarbage dofile error gcinfo next 116 syn keyword luaFunc assert collectgarbage dofile error gcinfo next
103 syn keyword luaFunc print rawget rawset tonumber tostring type _VERSION 117 syn keyword luaFunc print rawget rawset tonumber tostring type _VERSION
104 118
105 if lua_version == 4 119 if lua_version == 4
106 syn keyword luaFunc _ALERT _ERRORMESSAGE 120 syn keyword luaFunc _ALERT _ERRORMESSAGE
107 syn keyword luaFunc call copytagmethods dostring 121 syn keyword luaFunc call copytagmethods dostring
108 syn keyword luaFunc foreach foreachi getglobal getn 122 syn keyword luaFunc foreach foreachi getglobal getn
109 syn keyword luaFunc gettagmethod globals newtag 123 syn keyword luaFunc gettagmethod globals newtag
110 syn keyword luaFunc setglobal settag settagmethod sort 124 syn keyword luaFunc setglobal settag settagmethod sort
111 syn keyword luaFunc tag tinsert tremove 125 syn keyword luaFunc tag tinsert tremove
112 syn keyword luaFunc _INPUT _OUTPUT _STDIN _STDOUT _STDERR 126 syn keyword luaFunc _INPUT _OUTPUT _STDIN _STDOUT _STDERR
113 syn keyword luaFunc openfile closefile flush seek 127 syn keyword luaFunc openfile closefile flush seek
114 syn keyword luaFunc setlocale execute remove rename tmpname 128 syn keyword luaFunc setlocale execute remove rename tmpname
115 syn keyword luaFunc getenv date clock exit 129 syn keyword luaFunc getenv date clock exit
116 syn keyword luaFunc readfrom writeto appendto read write 130 syn keyword luaFunc readfrom writeto appendto read write
117 syn keyword luaFunc PI abs sin cos tan asin 131 syn keyword luaFunc PI abs sin cos tan asin
118 syn keyword luaFunc acos atan atan2 ceil floor 132 syn keyword luaFunc acos atan atan2 ceil floor
119 syn keyword luaFunc mod frexp ldexp sqrt min max log 133 syn keyword luaFunc mod frexp ldexp sqrt min max log
120 syn keyword luaFunc log10 exp deg rad random 134 syn keyword luaFunc log10 exp deg rad random
121 syn keyword luaFunc randomseed strlen strsub strlower strupper 135 syn keyword luaFunc randomseed strlen strsub strlower strupper
122 syn keyword luaFunc strchar strrep ascii strbyte 136 syn keyword luaFunc strchar strrep ascii strbyte
123 syn keyword luaFunc format strfind gsub 137 syn keyword luaFunc format strfind gsub
124 syn keyword luaFunc getinfo getlocal setlocal setcallhook setlinehook 138 syn keyword luaFunc getinfo getlocal setlocal setcallhook setlinehook
125 else 139 elseif lua_version == 5
126 syn keyword luaFunc _G getfenv getmetatable ipairs loadfile
127 syn keyword luaFunc loadlib loadstring pairs pcall rawequal
128 syn keyword luaFunc require setfenv setmetatable unpack xpcall
129 syn keyword luaFunc LUA_PATH _LOADED _REQUIREDNAME
130 " Not sure if all these functions need to be highlighted... 140 " Not sure if all these functions need to be highlighted...
131 syn match luaFunc /coroutine\.create/ 141 syn keyword luaFunc _G getfenv getmetatable ipairs loadfile
132 syn match luaFunc /coroutine\.resume/ 142 syn keyword luaFunc loadstring pairs pcall rawequal
133 syn match luaFunc /coroutine\.status/ 143 syn keyword luaFunc require setfenv setmetatable unpack xpcall
134 syn match luaFunc /coroutine\.wrap/ 144 if lua_subversion == 0
135 syn match luaFunc /coroutine\.yield/ 145 syn keyword luaFunc loadlib LUA_PATH _LOADED _REQUIREDNAME
136 syn match luaFunc /string\.byte/ 146 elseif lua_subversion == 1
137 syn match luaFunc /string\.char/ 147 syn keyword luaFunc load module select
138 syn match luaFunc /string\.dump/ 148 syn match luaFunc /package\.cpath/
139 syn match luaFunc /string\.find/ 149 syn match luaFunc /package\.loaded/
140 syn match luaFunc /string\.len/ 150 syn match luaFunc /package\.loadlib/
141 syn match luaFunc /string\.lower/ 151 syn match luaFunc /package\.path/
142 syn match luaFunc /string\.rep/ 152 syn match luaFunc /package\.preload/
143 syn match luaFunc /string\.sub/ 153 syn match luaFunc /package\.seeall/
144 syn match luaFunc /string\.upper/ 154 syn match luaFunc /coroutine\.running/
145 syn match luaFunc /string\.format/ 155 endif
146 syn match luaFunc /string\.gfind/ 156 syn match luaFunc /coroutine\.create/
147 syn match luaFunc /string\.gsub/ 157 syn match luaFunc /coroutine\.resume/
148 syn match luaFunc /table\.concat/ 158 syn match luaFunc /coroutine\.status/
149 syn match luaFunc /table\.foreach/ 159 syn match luaFunc /coroutine\.wrap/
150 syn match luaFunc /table\.foreachi/ 160 syn match luaFunc /coroutine\.yield/
151 syn match luaFunc /table\.getn/ 161 syn match luaFunc /string\.byte/
152 syn match luaFunc /table\.sort/ 162 syn match luaFunc /string\.char/
153 syn match luaFunc /table\.insert/ 163 syn match luaFunc /string\.dump/
154 syn match luaFunc /table\.remove/ 164 syn match luaFunc /string\.find/
155 syn match luaFunc /table\.setn/ 165 syn match luaFunc /string\.len/
156 syn match luaFunc /math\.abs/ 166 syn match luaFunc /string\.lower/
157 syn match luaFunc /math\.acos/ 167 syn match luaFunc /string\.rep/
158 syn match luaFunc /math\.asin/ 168 syn match luaFunc /string\.sub/
159 syn match luaFunc /math\.atan/ 169 syn match luaFunc /string\.upper/
160 syn match luaFunc /math\.atan2/ 170 syn match luaFunc /string\.format/
161 syn match luaFunc /math\.ceil/ 171 syn match luaFunc /string\.gsub/
162 syn match luaFunc /math\.cos/ 172 if lua_subversion == 0
163 syn match luaFunc /math\.deg/ 173 syn match luaFunc /string\.gfind/
164 syn match luaFunc /math\.exp/ 174 elseif lua_subversion == 1
165 syn match luaFunc /math\.floor/ 175 syn match luaFunc /string\.gmatch/
166 syn match luaFunc /math\.log/ 176 syn match luaFunc /string\.match/
167 syn match luaFunc /math\.log10/ 177 syn match luaFunc /string\.reverse/
168 syn match luaFunc /math\.max/ 178 syn match luaFunc /table\.maxn/
169 syn match luaFunc /math\.min/ 179 endif
170 syn match luaFunc /math\.mod/ 180 syn match luaFunc /table\.concat/
171 syn match luaFunc /math\.pow/ 181 syn match luaFunc /table\.foreach/
172 syn match luaFunc /math\.rad/ 182 syn match luaFunc /table\.foreachi/
173 syn match luaFunc /math\.sin/ 183 syn match luaFunc /table\.getn/
174 syn match luaFunc /math\.sqrt/ 184 syn match luaFunc /table\.sort/
175 syn match luaFunc /math\.tan/ 185 syn match luaFunc /table\.insert/
176 syn match luaFunc /math\.frexp/ 186 syn match luaFunc /table\.remove/
177 syn match luaFunc /math\.ldexp/ 187 syn match luaFunc /table\.setn/
178 syn match luaFunc /math\.random/ 188 syn match luaFunc /math\.abs/
179 syn match luaFunc /math\.randomseed/ 189 syn match luaFunc /math\.acos/
180 syn match luaFunc /math\.pi/ 190 syn match luaFunc /math\.asin/
181 syn match luaFunc /io\.stdin/ 191 syn match luaFunc /math\.atan/
182 syn match luaFunc /io\.stdout/ 192 syn match luaFunc /math\.atan2/
183 syn match luaFunc /io\.stderr/ 193 syn match luaFunc /math\.ceil/
184 syn match luaFunc /io\.close/ 194 syn match luaFunc /math\.sin/
185 syn match luaFunc /io\.flush/ 195 syn match luaFunc /math\.cos/
186 syn match luaFunc /io\.input/ 196 syn match luaFunc /math\.tan/
187 syn match luaFunc /io\.lines/ 197 syn match luaFunc /math\.deg/
188 syn match luaFunc /io\.open/ 198 syn match luaFunc /math\.exp/
189 syn match luaFunc /io\.output/ 199 syn match luaFunc /math\.floor/
190 syn match luaFunc /io\.popen/ 200 syn match luaFunc /math\.log/
191 syn match luaFunc /io\.read/ 201 syn match luaFunc /math\.log10/
192 syn match luaFunc /io\.tmpfile/ 202 syn match luaFunc /math\.max/
193 syn match luaFunc /io\.type/ 203 syn match luaFunc /math\.min/
194 syn match luaFunc /io\.write/ 204 if lua_subversion == 0
195 syn match luaFunc /os\.clock/ 205 syn match luaFunc /math\.mod/
196 syn match luaFunc /os\.date/ 206 elseif lua_subversion == 1
197 syn match luaFunc /os\.difftime/ 207 syn match luaFunc /math\.fmod/
198 syn match luaFunc /os\.execute/ 208 syn match luaFunc /math\.modf/
199 syn match luaFunc /os\.exit/ 209 syn match luaFunc /math\.cosh/
200 syn match luaFunc /os\.getenv/ 210 syn match luaFunc /math\.sinh/
201 syn match luaFunc /os\.remove/ 211 syn match luaFunc /math\.tanh/
202 syn match luaFunc /os\.rename/ 212 endif
203 syn match luaFunc /os\.setlocale/ 213 syn match luaFunc /math\.pow/
204 syn match luaFunc /os\.time/ 214 syn match luaFunc /math\.rad/
205 syn match luaFunc /os\.tmpname/ 215 syn match luaFunc /math\.sqrt/
206 syn match luaFunc /debug\.debug/ 216 syn match luaFunc /math\.frexp/
207 syn match luaFunc /debug\.gethook/ 217 syn match luaFunc /math\.ldexp/
208 syn match luaFunc /debug\.getinfo/ 218 syn match luaFunc /math\.random/
209 syn match luaFunc /debug\.getlocal/ 219 syn match luaFunc /math\.randomseed/
210 syn match luaFunc /debug\.getupvalue/ 220 syn match luaFunc /math\.pi/
211 syn match luaFunc /debug\.setlocal/ 221 syn match luaFunc /io\.stdin/
212 syn match luaFunc /debug\.setupvalue/ 222 syn match luaFunc /io\.stdout/
213 syn match luaFunc /debug\.sethook/ 223 syn match luaFunc /io\.stderr/
214 syn match luaFunc /debug\.traceback/ 224 syn match luaFunc /io\.close/
215 endif 225 syn match luaFunc /io\.flush/
216 226 syn match luaFunc /io\.input/
217 "syncing method 227 syn match luaFunc /io\.lines/
218 syn sync minlines=100 228 syn match luaFunc /io\.open/
229 syn match luaFunc /io\.output/
230 syn match luaFunc /io\.popen/
231 syn match luaFunc /io\.read/
232 syn match luaFunc /io\.tmpfile/
233 syn match luaFunc /io\.type/
234 syn match luaFunc /io\.write/
235 syn match luaFunc /os\.clock/
236 syn match luaFunc /os\.date/
237 syn match luaFunc /os\.difftime/
238 syn match luaFunc /os\.execute/
239 syn match luaFunc /os\.exit/
240 syn match luaFunc /os\.getenv/
241 syn match luaFunc /os\.remove/
242 syn match luaFunc /os\.rename/
243 syn match luaFunc /os\.setlocale/
244 syn match luaFunc /os\.time/
245 syn match luaFunc /os\.tmpname/
246 syn match luaFunc /debug\.debug/
247 syn match luaFunc /debug\.gethook/
248 syn match luaFunc /debug\.getinfo/
249 syn match luaFunc /debug\.getlocal/
250 syn match luaFunc /debug\.getupvalue/
251 syn match luaFunc /debug\.setlocal/
252 syn match luaFunc /debug\.setupvalue/
253 syn match luaFunc /debug\.sethook/
254 syn match luaFunc /debug\.traceback/
255 if lua_subversion == 1
256 syn match luaFunc /debug\.getfenv/
257 syn match luaFunc /debug\.getmetatable/
258 syn match luaFunc /debug\.getregistry/
259 syn match luaFunc /debug\.setfenv/
260 syn match luaFunc /debug\.setmetatable/
261 endif
262 endif
219 263
220 " Define the default highlighting. 264 " Define the default highlighting.
221 " For version 5.7 and earlier: only when not done already 265 " For version 5.7 and earlier: only when not done already
222 " For version 5.8 and later: only when an item doesn't have highlighting yet 266 " For version 5.8 and later: only when an item doesn't have highlighting yet
223 if version >= 508 || !exists("did_lua_syntax_inits") 267 if version >= 508 || !exists("did_lua_syntax_inits")
241 HiLink luaComment Comment 285 HiLink luaComment Comment
242 HiLink luaTodo Todo 286 HiLink luaTodo Todo
243 HiLink luaTable Structure 287 HiLink luaTable Structure
244 HiLink luaError Error 288 HiLink luaError Error
245 HiLink luaSpecial SpecialChar 289 HiLink luaSpecial SpecialChar
246 " HiLink luaPreProc PreProc
247 HiLink luaFunc Identifier 290 HiLink luaFunc Identifier
248 291
249 delcommand HiLink 292 delcommand HiLink
250 endif 293 endif
251 294
252 let b:current_syntax = "lua" 295 let b:current_syntax = "lua"
253 296
254 " vim: noet ts=8 297 " vim: et ts=8