language-lua-plus

Lua grammar and snippets for Atom.

Ademir J. Ferreira Junior

12,446

2

1.7.1

MIT

GitHub

This package provides the following services:

Language Lua Plus

Lua grammar and snippets for Atom.

Suggestions: Lua Keywords and Constructs

return

return

do

do
»
end

if

if not condition then
»
end

ifel

if not condition then
»
else
»
end

elseif

elseif not condition then
»

else

else
»

while

while not condition do
»
end

repeat

repeat
»
until not condition

for

for i = 1, 10, i_step do
»
end

forn

for k, v in next, tbl do
»
end

forp

for k, v in pairs(tbl) do
»
end

fori

for i, v in ipairs(tbl) do
»
end

tern

condition and true or false

func

function func(params)
»
end

funcdef

function (params)
»
end

Suggestions: Standard Lua Libraries

Basic

ver

_VERSION

sprint

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)

Coroutine

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)

Package

sreq

require 'name'

req

require(name)

packconfig

package.config

packcpath

package.cpath

packloaded

package.loaded

packloadlib

package.loadlib(lib, func)

packpath

package.path

packpreload

package.preload

packs

package.searchers

packspath

package.searchpath(name, path, sep, rep)

String

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)

UTF-8

utfchar

utf8.char(number)

utfcharpattern

utf8.charpattern

utfcodepoint

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)

Table

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)

Math

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.huge

mathlog

math.log(x, base)

mathmax

math.max(args)

mathmaxint

math.maxinteger

mathmin

math.min(args)

mathminint

math.mininteger

mathmodf

math.modf(x)

mathpi

math.pi

mathrad

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)

IO

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)

OS

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()

Debug

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)

References

License

This package is under a MIT license.