annotate runtime/syntax/lua.vim @ 2238:3d0a7beb0d75 vim73

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