Lua grammar and snippets for Atom.
return
returndo
do
»
endif
if not condition then
»
endifel
if not condition then
»
else
»
endelseif
elseif not condition then
»else
else
»while
while not condition do
»
endrepeat
repeat
»
until not conditionfor
for i = 1, 10, i_step do
»
endforn
for k, v in next, tbl do
»
endforp
for k, v in pairs(tbl) do
»
endfori
for i, v in ipairs(tbl) do
»
endtern
condition and true or falsefunc
function func(params)
»
endfuncdef
function (params)
»
endver
_VERSIONsprint
print 'text'print
print(args)assert
assert(value, msg)cgar
collectgarbage(action, arg)dofile
dofile(file)error
error(msg, level)getmeta
getmetatable(obj)ipairs
ipairs(tbl)load
load(chunk, chunk_name, mode, env)loadfile
loadfile(file, mode, env)next
next(tbl, index)pairs
pairs(tbl)pcall
pcall(func, args)rawequal
rawequal(value1, value2)rawget
rawget(tbl, index)rawlen
rawlen(obj)rawset
rawset(tbl, index, value)select
select(arg, args)setmeta
setmetatable(obj, metatbl)tonumber
tonumber(value, base)tostring
tostring(value)type
type(var)xpcall
xpcall(func, msgh, args)corcreate
coroutine.create(func)corisyield
coroutine.isyieldable()corres
coroutine.resume(coro, args)corrun
coroutine.running()corstatus
coroutine.status(coro)corwrap
coroutine.wrap(func)coryield
coroutine.yield(extra)sreq
require 'name'req
require(name)packconfig
package.configpackcpath
package.cpathpackloaded
package.loadedpackloadlib
package.loadlib(lib, func)packpath
package.pathpackpreload
package.preloadpacks
package.searcherspackspath
package.searchpath(name, path, sep, rep)strbyte
string.byte(str, i_start, i_end)strchar
string.char(bytes)strdump
string.dump(func, strip)strfind
string.find(str, pattern, i_start, plain)strformat
string.format(format, args)strgmatch
string.gmatch(str, pattern)strgsub
string.gsub(str, pattern, repl, n)strlen
string.len(str)strlower
string.lower(str)strmatch
string.match(str, pattern, i_start)strpack
string.pack(format, args)strpacksize
string.packsize(format)strrep
string.rep(str, n, sep)strreverse
string.reverse(str)strsub
string.sub(str, i_start, i_end)strunpack
string.unpack(format, str, i)strupper
string.upper(str)utfchar
utf8.char(number)utfcharpattern
utf8.charpatternutfcodepoint
utf8.codepoint(str, i_start, i_end)utfcodes
utf8.codes(str)utflen
utf8.len(str, i_start, i_end)utfoffset
utf8.offset(str, n, i_start)tabcon
table.concat(tbl, sep, i_start, i_end)tabins
table.insert(tbl, i, value)tabmove
table.move(tbl1, f, e, t, tbl2)tabpack
table.pack(args)tabrem
table.remove(tbl, i)tabsort
table.sort(tbl, func)tabunpack
table.unpack(tbl, i_start, i_end)mathabs
math.abs(x)mathacos
math.acos(x)mathasin
math.asin(x)mathatan
math.atan(y, x)mathceil
math.ceil(x)mathcos
math.cos(x)mathdeg
math.deg(x)mathexp
math.exp(x)mathfloor
math.floor(x)mathfmod
math.fmod(x, y)mathhuge
math.hugemathlog
math.log(x, base)mathmax
math.max(args)mathmaxint
math.maxintegermathmin
math.min(args)mathminint
math.minintegermathmodf
math.modf(x)mathpi
math.pimathrad
math.rad(x)mathran
math.random(x)mathranseed
math.randomseed(x)mathsin
math.sin(x)mathsqrt
math.sqrt(x)mathtan
math.tan(x)mathtoint
math.tointeger(x)mathtype
math.type(x)mathult
math.ult(m, n)ioclose
io.close(file)ioflush
io.flush()ioinput
io.input(file)iolines
io.lines(file, formats)ioopen
io.open(file, mode)iooutput
io.output(file)iopopen
io.popen(prog, mode)ioread
io.read(formats)iotmpfile
io.tmpfile()iotype
io.type(obj)iowrite
io.write(args)fileclose
file:close()fileflush
file:flush()filelines
file:lines(formats)fileread
file:read(formats)fileseek
file:seek(whence, offset)filesvbuf
file:setvbuf(mode, size)filewrite
file:write(args)osclock
os.clock()osdate
os.date(format, time)osdiff
os.difftime(t2, t1)osexec
os.execute(cmd)osexit
os.exit(code, close)osgenv
os.getenv(var)osrem
os.remove(file)osren
os.rename(old_name, new_name)osslocale
os.setlocale(locale, category)ostime
os.time(tbl)ostmpname
os.tmpname()deb
debug.debug()debghook
debug.gethook(thread)debginfo
debug.getinfo(thread, func_level, fields)debglocal
debug.getlocal(thread, func_level, index)debgmeta
debug.getmetatable(obj)debgreg
debug.getregistry()debgup
debug.getupvalue(func, index)debguser
debug.getuservalue(udata)debshook
debug.sethook(thread, hook, mask, count)debslocal
debug.setlocal(thread, level, index, value)debsmeta
debug.setmetatable(obj, metatbl)debsup
debug.setupvalue(func, index, value)debsuser
debug.setuservalue(udata, value)debtb
debug.traceback(thread, msg, level)debupid
debug.upvalueid(func, index)debupjoin
debug.upvaluejoin(f1, n1, f2, n2)This package is under a MIT license.