forked from zufuliu/notepad4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLua.lua
More file actions
243 lines (229 loc) · 4.51 KB
/
Lua.lua
File metadata and controls
243 lines (229 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
-- Lua 5.0 to 5.5 https://www.lua.org/manual/
-- http://lua-users.org/wiki/
--! keywords =======================================================
and
break
false
for do
end
function
end
global
goto
in
if then
else
elseif
end
local
nil not
or
repeat
until
return
then true
while
--! Metamethod =======================================================
-- Metatables and Metamethods
__add
__band
__bnot
__bor
__bxor
__call
__close
__concat
__div
__eq
__gc
__idiv
__index
__le
__len
__lt
__metatable
__mod
__mode
__mul
__name
__newindex
__pairs
__pow
__shl
__shr
__sub
__tostring
__unm
--! Basic Function =======================================================
_G
_VERSION
assert(v [, message])
collectgarbage([opt [, arg]])
-- opt for collectgarbage()
"collect stop restart count step isrunning incremental generational param"
dofile([filename])
error(message [, level])
getmetatable(object)
ipairs(t)
load(chunk [, chunkname [, mode [, env]]])
loadfile([filename [, mode [, env]]])
next(table [, index])
pairs(t)
pcall(f [, arg1, ···])
print(···)
rawequal(v1, v2)
rawget(table, index)
rawlen(v)
rawset(table, index, value)
require(modname)
select(index, ···)
setmetatable(table, metatable)
tonumber(e [, base])
tostring(v)
type(v)
-- results for type() function
"nil number string boolean table function thread userdata"
warn(msg1, ···)
xpcall(f, msgh [, arg1, ···])
--! library =======================================================
-- The Standard Libraries
-- Coroutine Manipulation
coroutine.close(co)
coroutine.create(f)
coroutine.isyieldable([co])
coroutine.resume(co [, val1, ···])
coroutine.running()
coroutine.status(co)
coroutine.wrap(f)
coroutine.yield(···)
-- Modules
require(modname)
package.config
package.cpath
package.loaded
package.loadlib(libname, funcname)
package.path
package.preload
package.searchers
package.searchpath(name, path [, sep [, rep]])
-- String Manipulation
string.byte(s [, i [, j]])
string.char(···)
string.dump(Function [, strip])
string.find(s, pattern [, init [, plain]])
string.format(formatstring, ···)
string.gmatch(s, pattern [, init])
string.gsub(s, pattern, repl [, n])
string.len(s)
string.lower(s)
string.match(s, pattern [, init])
string.pack(fmt, v1, v2, ···)
string.packsize(fmt)
string.rep(s, n [, sep])
string.reverse(s)
string.sub(s, i [, j])
string.unpack(fmt, s [, pos])
string.upper(s)
-- UTF-8 Support
utf8.char(···)
utf8.charpattern
utf8.codes(s [, lax])
utf8.codepoint(s [, i [, j [, lax]]])
utf8.len(s [, i [, j [, lax]]])
utf8.offset(s, n [, i])
-- Table Manipulation
table.concat(list [, sep [, i [, j]]])
table.create(nseq [, nrec])
table.insert(list, [pos,] value)
table.move(a1, f, e, t [,a2])
table.pack(···)
table.remove(list [, pos])
table.sort(list [, comp])
table.unpack(list [, i [, j]])
-- Mathematical Functions
math.abs(x)
math.acos(x)
math.asin(x)
math.atan(y [, x])
math.ceil(x)
math.cos(x)
math.deg(x)
math.exp(x)
math.floor(x)
math.fmod(x, y)
math.frexp(x)
math.huge
math.ldexp(m, e)
math.log(x [, base])
math.max(x, ···)
math.maxinteger
math.min(x, ···)
math.mininteger
math.modf(x)
math.pi
math.rad(x)
math.random([m [, n]])
math.randomseed([x [, y]])
math.sin(x)
math.sqrt(x)
math.tan(x)
math.tointeger(x)
math.type(x)
-- results for math.type() function
"integer float"
math.ult(m, n)
-- Input and Output Facilities
io.close([file])
io.flush()
io.input([file])
io.lines([filename, ···])
io.open(filename [, mode])
io.output([file])
io.popen(prog [, mode])
io.stdin
io.stdout
io.stderr
io.read(···)
io.tmpfile()
io.type(obj)
-- results for io.type() function
"file"
io.write(···)
file:close()
file:flush()
file:lines(···)
file:read(···)
file:seek([whence [, offset]])
file:setvbuf(mode [, size])
file:write(···)
-- Operating System Facilities
os.clock()
os.date([format [, time]])
os.difftime(t2, t1)
os.execute([command])
os.exit([code [, close]])
os.getenv(varname)
os.remove(filename)
os.rename(oldname, newname)
os.setlocale(locale [, category])
os.time([table])
os.tmpname()
-- The Debug Library
debug.debug()
debug.gethook([thread])
debug.getinfo([thread,] f [, what])
debug.getlocal([thread,] f, local)
debug.getmetatable(value)
debug.getregistry()
debug.getupvalue(f, up)
debug.getuservalue(u, n)
debug.sethook([thread,] hook, mask [, count])
debug.setlocal([thread,] level, local, value)
debug.setmetatable(value, table)
debug.setupvalue(f, up, value)
debug.setuservalue(udata, value, n)
debug.traceback([thread,] [message [, level]])
debug.upvalueid(f, n)
debug.upvaluejoin(f1, n1, f2, n2)
-- environment variables
"LUA_CPATH LUA_INIT LUA_PATH"