annotate runtime/syntax/lua.vim @ 31815:64f03e860c91 v9.0.1240

patch 9.0.1240: cannot access a private object member in a lambda Commit: https://github.com/vim/vim/commit/62a6923470827acbf124df41134ae6df52f334e6 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 24 15:07:04 2023 +0000 patch 9.0.1240: cannot access a private object member in a lambda Problem: Cannot access a private object member in a lambda defined inside the class. Solution: Go up the context stack to find the class. (closes #11866)
author Bram Moolenaar <Bram@vim.org>
date Tue, 24 Jan 2023 16:15:07 +0100
parents 0827d3d6d8c0
children
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
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
2 " Language: Lua 4.0, Lua 5.0, Lua 5.1, Lua 5.2 and Lua 5.3
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
3 " Maintainer: Marcus Aurelius Farias <masserahguard-lua 'at' yahoo com>
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
4 " First Author: Carlos Augusto Teixeira Mendes <cmendes 'at' inf puc-rio br>
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
5 " Last Change: 2022 Sep 07
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
6 " Options: lua_version = 4 or 5
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
7 " lua_subversion = 0 (for 4.0 or 5.0)
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
8 " or 1, 2, 3 (for 5.1, 5.2 or 5.3)
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
9 " the default is 5.3
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
10
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3750
diff changeset
11 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3750
diff changeset
12 if exists("b:current_syntax")
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
13 finish
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
14 endif
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
15
3356
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
16 let s:cpo_save = &cpo
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
17 set cpo&vim
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
18
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
19 if !exists("lua_version")
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
20 " Default is lua 5.3
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
21 let lua_version = 5
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
22 let lua_subversion = 3
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
23 elseif !exists("lua_subversion")
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
24 " lua_version exists, but lua_subversion doesn't. In this case set it to 0
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
25 let lua_subversion = 0
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
26 endif
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
27
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
28 syn case match
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
29
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
30 " syncing method
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
31 syn sync minlines=1000
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
32
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
33 if lua_version >= 5
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
34 syn keyword luaMetaMethod __add __sub __mul __div __pow __unm __concat
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
35 syn keyword luaMetaMethod __eq __lt __le
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
36 syn keyword luaMetaMethod __index __newindex __call
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
37 syn keyword luaMetaMethod __metatable __mode __gc __tostring
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
38 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
39
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
40 if lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
41 syn keyword luaMetaMethod __mod __len
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
42 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
43
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
44 if lua_version > 5 || (lua_version == 5 && lua_subversion >= 2)
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
45 syn keyword luaMetaMethod __pairs
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
46 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
47
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
48 if lua_version > 5 || (lua_version == 5 && lua_subversion >= 3)
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
49 syn keyword luaMetaMethod __idiv __name
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
50 syn keyword luaMetaMethod __band __bor __bxor __bnot __shl __shr
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
51 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
52
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
53 if lua_version > 5 || (lua_version == 5 && lua_subversion >= 4)
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
54 syn keyword luaMetaMethod __close
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
55 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
56
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
57 " catch errors caused by wrong parenthesis and wrong curly brackets or
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
58 " keywords placed outside their respective blocks
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
59
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
60 syn region luaParen transparent start='(' end=')' contains=TOP,luaParenError
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
61 syn match luaParenError ")"
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
62 syn match luaError "}"
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
63 syn match luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>"
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
64
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
65 " Function declaration
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
66 syn region luaFunctionBlock transparent matchgroup=luaFunction start="\<function\>" end="\<end\>" contains=TOP
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
67
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
68 " else
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
69 syn keyword luaCondElse matchgroup=luaCond contained containedin=luaCondEnd else
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
70
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
71 " then ... end
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
72 syn region luaCondEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=TOP
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
73
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
74 " elseif ... then
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
75 syn region luaCondElseif contained containedin=luaCondEnd transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=TOP
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
76
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
77 " if ... then
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
78 syn region luaCondStart transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=TOP nextgroup=luaCondEnd skipwhite skipempty
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
79
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
80 " do ... end
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
81 syn region luaBlock transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=TOP
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
82 " repeat ... until
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
83 syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=TOP
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
84
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
85 " while ... do
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
86 syn region luaWhile transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=TOP nextgroup=luaBlock skipwhite skipempty
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
87
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
88 " for ... do and for ... in ... do
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
89 syn region luaFor transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=TOP nextgroup=luaBlock skipwhite skipempty
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
90
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
91 syn keyword luaFor contained containedin=luaFor in
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
92
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
93 " other keywords
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
94 syn keyword luaStatement return local break
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
95 if lua_version > 5 || (lua_version == 5 && lua_subversion >= 2)
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
96 syn keyword luaStatement goto
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
97 syn match luaLabel "::\I\i*::"
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
98 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
99
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
100 " operators
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
101 syn keyword luaOperator and or not
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
102
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
103 if (lua_version == 5 && lua_subversion >= 3) || lua_version > 5
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
104 syn match luaSymbolOperator "[#<>=~^&|*/%+-]\|\.\{2,3}"
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
105 elseif lua_version == 5 && (lua_subversion == 1 || lua_subversion == 2)
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
106 syn match luaSymbolOperator "[#<>=~^*/%+-]\|\.\{2,3}"
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
107 else
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
108 syn match luaSymbolOperator "[<>=~^*/+-]\|\.\{2,3}"
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
109 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
110
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
111 " comments
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
112 syn keyword luaTodo contained TODO FIXME XXX
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
113 syn match luaComment "--.*$" contains=luaTodo,@Spell
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
114 if lua_version == 5 && lua_subversion == 0
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
115 syn region luaComment matchgroup=luaCommentDelimiter start="--\[\[" end="\]\]" contains=luaTodo,luaInnerComment,@Spell
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
116 syn region luaInnerComment contained transparent start="\[\[" end="\]\]"
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
117 elseif lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
118 " Comments in Lua 5.1: --[[ ... ]], [=[ ... ]=], [===[ ... ]===], etc.
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
119 syn region luaComment matchgroup=luaCommentDelimiter start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaTodo,@Spell
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
120 endif
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
121
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
122 " first line may start with #!
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
123 syn match luaComment "\%^#!.*"
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
124
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
125 syn keyword luaConstant nil
838
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 luaConstant true false
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
128 endif
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
129
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
130 " strings
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
131 syn match luaSpecial contained #\\[\\abfnrtv'"[\]]\|\\[[:digit:]]\{,3}#
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
132 if lua_version == 5
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
133 if lua_subversion == 0
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
134 syn region luaString2 matchgroup=luaStringDelimiter start=+\[\[+ end=+\]\]+ contains=luaString2,@Spell
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
135 else
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
136 if lua_subversion >= 2
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
137 syn match luaSpecial contained #\\z\|\\x[[:xdigit:]]\{2}#
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
138 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
139 if lua_subversion >= 3
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
140 syn match luaSpecial contained #\\u{[[:xdigit:]]\+}#
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
141 endif
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
142 syn region luaString2 matchgroup=luaStringDelimiter start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
143 endif
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
144 endif
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
145 syn region luaString matchgroup=luaStringDelimiter start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecial,@Spell
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
146 syn region luaString matchgroup=luaStringDelimiter start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecial,@Spell
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
147
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
148 " integer number
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 838
diff changeset
149 syn match luaNumber "\<\d\+\>"
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
150 " floating point number, with dot, optional exponent
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
151 syn match luaNumber "\<\d\+\.\d*\%([eE][-+]\=\d\+\)\="
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
152 " floating point number, starting with a dot, optional exponent
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
153 syn match luaNumber "\.\d\+\%([eE][-+]\=\d\+\)\=\>"
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
154 " floating point number, without dot, with exponent
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
155 syn match luaNumber "\<\d\+[eE][-+]\=\d\+\>"
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 838
diff changeset
156
e63691e7c504 updated for version 7.1a
vimboss
parents: 838
diff changeset
157 " hex numbers
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
158 if lua_version >= 5
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
159 if lua_subversion == 1
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
160 syn match luaNumber "\<0[xX]\x\+\>"
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
161 elseif lua_subversion >= 2
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
162 syn match luaNumber "\<0[xX][[:xdigit:].]\+\%([pP][-+]\=\d\+\)\=\>"
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
163 endif
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 838
diff changeset
164 endif
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
165
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
166 " tables
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
167 syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=TOP,luaStatement
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
168
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
169 " methods
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
170 syntax match luaFunc ":\@<=\k\+"
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
171
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
172 " built-in functions
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
173 syn keyword luaFunc assert collectgarbage dofile error next
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
174 syn keyword luaFunc print rawget rawset self tonumber tostring type _VERSION
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
175
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
176 if lua_version == 4
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
177 syn keyword luaFunc _ALERT _ERRORMESSAGE gcinfo
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
178 syn keyword luaFunc call copytagmethods dostring
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
179 syn keyword luaFunc foreach foreachi getglobal getn
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
180 syn keyword luaFunc gettagmethod globals newtag
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
181 syn keyword luaFunc setglobal settag settagmethod sort
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
182 syn keyword luaFunc tag tinsert tremove
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
183 syn keyword luaFunc _INPUT _OUTPUT _STDIN _STDOUT _STDERR
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
184 syn keyword luaFunc openfile closefile flush seek
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
185 syn keyword luaFunc setlocale execute remove rename tmpname
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
186 syn keyword luaFunc getenv date clock exit
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
187 syn keyword luaFunc readfrom writeto appendto read write
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
188 syn keyword luaFunc PI abs sin cos tan asin
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
189 syn keyword luaFunc acos atan atan2 ceil floor
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
190 syn keyword luaFunc mod frexp ldexp sqrt min max log
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
191 syn keyword luaFunc log10 exp deg rad random
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
192 syn keyword luaFunc randomseed strlen strsub strlower strupper
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
193 syn keyword luaFunc strchar strrep ascii strbyte
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
194 syn keyword luaFunc format strfind gsub
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
195 syn keyword luaFunc getinfo getlocal setlocal setcallhook setlinehook
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
196 elseif lua_version == 5
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
197 syn keyword luaFunc getmetatable setmetatable
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
198 syn keyword luaFunc ipairs pairs
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
199 syn keyword luaFunc pcall xpcall
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
200 syn keyword luaFunc _G loadfile rawequal require
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
201 if lua_subversion == 0
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
202 syn keyword luaFunc getfenv setfenv
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
203 syn keyword luaFunc loadstring unpack
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
204 syn keyword luaFunc gcinfo loadlib LUA_PATH _LOADED _REQUIREDNAME
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
205 else
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
206 syn keyword luaFunc load select
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
207 syn match luaFunc /\<package\.cpath\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
208 syn match luaFunc /\<package\.loaded\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
209 syn match luaFunc /\<package\.loadlib\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
210 syn match luaFunc /\<package\.path\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
211 syn match luaFunc /\<package\.preload\>/
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
212 if lua_subversion == 1
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
213 syn keyword luaFunc getfenv setfenv
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
214 syn keyword luaFunc loadstring module unpack
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
215 syn match luaFunc /\<package\.loaders\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
216 syn match luaFunc /\<package\.seeall\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
217 elseif lua_subversion >= 2
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
218 syn keyword luaFunc _ENV rawlen
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
219 syn match luaFunc /\<package\.config\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
220 syn match luaFunc /\<package\.preload\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
221 syn match luaFunc /\<package\.searchers\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
222 syn match luaFunc /\<package\.searchpath\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
223 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
224
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
225 if lua_subversion >= 3
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
226 syn match luaFunc /\<coroutine\.isyieldable\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
227 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
228 if lua_subversion >= 4
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
229 syn keyword luaFunc warn
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
230 syn match luaFunc /\<coroutine\.close\>/
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
231 endif
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
232 syn match luaFunc /\<coroutine\.running\>/
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
233 endif
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
234 syn match luaFunc /\<coroutine\.create\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
235 syn match luaFunc /\<coroutine\.resume\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
236 syn match luaFunc /\<coroutine\.status\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
237 syn match luaFunc /\<coroutine\.wrap\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
238 syn match luaFunc /\<coroutine\.yield\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
239
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
240 syn match luaFunc /\<string\.byte\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
241 syn match luaFunc /\<string\.char\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
242 syn match luaFunc /\<string\.dump\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
243 syn match luaFunc /\<string\.find\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
244 syn match luaFunc /\<string\.format\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
245 syn match luaFunc /\<string\.gsub\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
246 syn match luaFunc /\<string\.len\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
247 syn match luaFunc /\<string\.lower\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
248 syn match luaFunc /\<string\.rep\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
249 syn match luaFunc /\<string\.sub\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
250 syn match luaFunc /\<string\.upper\>/
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
251 if lua_subversion == 0
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
252 syn match luaFunc /\<string\.gfind\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
253 else
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
254 syn match luaFunc /\<string\.gmatch\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
255 syn match luaFunc /\<string\.match\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
256 syn match luaFunc /\<string\.reverse\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
257 endif
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
258 if lua_subversion >= 3
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
259 syn match luaFunc /\<string\.pack\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
260 syn match luaFunc /\<string\.packsize\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
261 syn match luaFunc /\<string\.unpack\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
262 syn match luaFunc /\<utf8\.char\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
263 syn match luaFunc /\<utf8\.charpattern\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
264 syn match luaFunc /\<utf8\.codes\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
265 syn match luaFunc /\<utf8\.codepoint\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
266 syn match luaFunc /\<utf8\.len\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
267 syn match luaFunc /\<utf8\.offset\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
268 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
269
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
270 if lua_subversion == 0
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
271 syn match luaFunc /\<table\.getn\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
272 syn match luaFunc /\<table\.setn\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
273 syn match luaFunc /\<table\.foreach\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
274 syn match luaFunc /\<table\.foreachi\>/
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
275 elseif lua_subversion == 1
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
276 syn match luaFunc /\<table\.maxn\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
277 elseif lua_subversion >= 2
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
278 syn match luaFunc /\<table\.pack\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
279 syn match luaFunc /\<table\.unpack\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
280 if lua_subversion >= 3
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
281 syn match luaFunc /\<table\.move\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
282 endif
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
283 endif
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
284 syn match luaFunc /\<table\.concat\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
285 syn match luaFunc /\<table\.insert\>/
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
286 syn match luaFunc /\<table\.sort\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
287 syn match luaFunc /\<table\.remove\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
288
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
289 if lua_subversion == 2
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
290 syn match luaFunc /\<bit32\.arshift\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
291 syn match luaFunc /\<bit32\.band\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
292 syn match luaFunc /\<bit32\.bnot\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
293 syn match luaFunc /\<bit32\.bor\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
294 syn match luaFunc /\<bit32\.btest\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
295 syn match luaFunc /\<bit32\.bxor\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
296 syn match luaFunc /\<bit32\.extract\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
297 syn match luaFunc /\<bit32\.lrotate\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
298 syn match luaFunc /\<bit32\.lshift\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
299 syn match luaFunc /\<bit32\.replace\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
300 syn match luaFunc /\<bit32\.rrotate\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
301 syn match luaFunc /\<bit32\.rshift\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
302 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
303
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
304 syn match luaFunc /\<math\.abs\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
305 syn match luaFunc /\<math\.acos\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
306 syn match luaFunc /\<math\.asin\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
307 syn match luaFunc /\<math\.atan\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
308 if lua_subversion < 3
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
309 syn match luaFunc /\<math\.atan2\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
310 endif
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
311 syn match luaFunc /\<math\.ceil\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
312 syn match luaFunc /\<math\.sin\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
313 syn match luaFunc /\<math\.cos\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
314 syn match luaFunc /\<math\.tan\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
315 syn match luaFunc /\<math\.deg\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
316 syn match luaFunc /\<math\.exp\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
317 syn match luaFunc /\<math\.floor\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
318 syn match luaFunc /\<math\.log\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
319 syn match luaFunc /\<math\.max\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
320 syn match luaFunc /\<math\.min\>/
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
321 if lua_subversion == 0
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
322 syn match luaFunc /\<math\.mod\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
323 syn match luaFunc /\<math\.log10\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
324 elseif lua_subversion == 1
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
325 syn match luaFunc /\<math\.log10\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
326 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
327 if lua_subversion >= 1
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
328 syn match luaFunc /\<math\.huge\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
329 syn match luaFunc /\<math\.fmod\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
330 syn match luaFunc /\<math\.modf\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
331 if lua_subversion == 1 || lua_subversion == 2
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
332 syn match luaFunc /\<math\.cosh\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
333 syn match luaFunc /\<math\.sinh\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
334 syn match luaFunc /\<math\.tanh\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
335 endif
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
336 endif
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
337 syn match luaFunc /\<math\.rad\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
338 syn match luaFunc /\<math\.sqrt\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
339 if lua_subversion < 3
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
340 syn match luaFunc /\<math\.pow\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
341 syn match luaFunc /\<math\.frexp\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
342 syn match luaFunc /\<math\.ldexp\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
343 else
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
344 syn match luaFunc /\<math\.maxinteger\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
345 syn match luaFunc /\<math\.mininteger\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
346 syn match luaFunc /\<math\.tointeger\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
347 syn match luaFunc /\<math\.type\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
348 syn match luaFunc /\<math\.ult\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
349 endif
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
350 syn match luaFunc /\<math\.random\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
351 syn match luaFunc /\<math\.randomseed\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
352 syn match luaFunc /\<math\.pi\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
353
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
354 syn match luaFunc /\<io\.close\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
355 syn match luaFunc /\<io\.flush\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
356 syn match luaFunc /\<io\.input\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
357 syn match luaFunc /\<io\.lines\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
358 syn match luaFunc /\<io\.open\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
359 syn match luaFunc /\<io\.output\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
360 syn match luaFunc /\<io\.popen\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
361 syn match luaFunc /\<io\.read\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
362 syn match luaFunc /\<io\.stderr\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
363 syn match luaFunc /\<io\.stdin\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
364 syn match luaFunc /\<io\.stdout\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
365 syn match luaFunc /\<io\.tmpfile\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
366 syn match luaFunc /\<io\.type\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
367 syn match luaFunc /\<io\.write\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
368
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
369 syn match luaFunc /\<os\.clock\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
370 syn match luaFunc /\<os\.date\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
371 syn match luaFunc /\<os\.difftime\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
372 syn match luaFunc /\<os\.execute\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
373 syn match luaFunc /\<os\.exit\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
374 syn match luaFunc /\<os\.getenv\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
375 syn match luaFunc /\<os\.remove\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
376 syn match luaFunc /\<os\.rename\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
377 syn match luaFunc /\<os\.setlocale\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
378 syn match luaFunc /\<os\.time\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
379 syn match luaFunc /\<os\.tmpname\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
380
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
381 syn match luaFunc /\<debug\.debug\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
382 syn match luaFunc /\<debug\.gethook\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
383 syn match luaFunc /\<debug\.getinfo\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
384 syn match luaFunc /\<debug\.getlocal\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
385 syn match luaFunc /\<debug\.getupvalue\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
386 syn match luaFunc /\<debug\.setlocal\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
387 syn match luaFunc /\<debug\.setupvalue\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
388 syn match luaFunc /\<debug\.sethook\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
389 syn match luaFunc /\<debug\.traceback\>/
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
390 if lua_subversion == 1
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
391 syn match luaFunc /\<debug\.getfenv\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
392 syn match luaFunc /\<debug\.setfenv\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
393 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
394 if lua_subversion >= 1
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
395 syn match luaFunc /\<debug\.getmetatable\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
396 syn match luaFunc /\<debug\.setmetatable\>/
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
397 syn match luaFunc /\<debug\.getregistry\>/
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
398 if lua_subversion >= 2
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
399 syn match luaFunc /\<debug\.getuservalue\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
400 syn match luaFunc /\<debug\.setuservalue\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
401 syn match luaFunc /\<debug\.upvalueid\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
402 syn match luaFunc /\<debug\.upvaluejoin\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
403 endif
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
404 if lua_subversion >= 4
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
405 syn match luaFunc /\<debug.setcstacklimit\>/
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
406 endif
28379
6dd88e45d47d Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
407 endif
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
408 endif
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
409
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
410 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 3750
diff changeset
411 " Only when an item doesn't have highlighting yet
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
412
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
413 hi def link luaStatement Statement
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
414 hi def link luaRepeat Repeat
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
415 hi def link luaFor Repeat
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
416 hi def link luaString String
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
417 hi def link luaString2 String
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
418 hi def link luaStringDelimiter luaString
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
419 hi def link luaNumber Number
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
420 hi def link luaOperator Operator
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
421 hi def link luaSymbolOperator luaOperator
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
422 hi def link luaConstant Constant
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
423 hi def link luaCond Conditional
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
424 hi def link luaCondElse Conditional
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
425 hi def link luaFunction Function
30324
0827d3d6d8c0 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30202
diff changeset
426 hi def link luaMetaMethod Function
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
427 hi def link luaComment Comment
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
428 hi def link luaCommentDelimiter luaComment
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
429 hi def link luaTodo Todo
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
430 hi def link luaTable Structure
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
431 hi def link luaError Error
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
432 hi def link luaParenError Error
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
433 hi def link luaSpecial SpecialChar
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
434 hi def link luaFunc Identifier
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28379
diff changeset
435 hi def link luaLabel Label
838
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
436
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
437
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
438 let b:current_syntax = "lua"
8e5830943bff updated for version 7.0e04
vimboss
parents: 837
diff changeset
439
3356
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
440 let &cpo = s:cpo_save
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
441 unlet s:cpo_save
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
442 " vim: et ts=8 sw=2