annotate runtime/syntax/lua.vim @ 0:76efa0be13f1

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