| 1 |
%%% spelling-doc-lst-lua.tex |
| 2 |
%%% Copyright 2013 Stephan Hennig |
| 3 |
%% |
| 4 |
%% This work may be distributed and/or modified under the conditions of |
| 5 |
%% the LaTeX Project Public License, either version 1.3 of this license |
| 6 |
%% or (at your option) any later version. The latest version of this |
| 7 |
%% license is in http://www.latex-project.org/lppl.txt |
| 8 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 9 |
%% version 2005/12/01 or later. |
| 10 |
%% |
| 11 |
\lstdefinelanguage[5.2]{Lua}{% |
| 12 |
alsoletter={.},% |
| 13 |
% language keywords |
| 14 |
morekeywords=[1]{% |
| 15 |
and,break,do,else,elseif,end,% |
| 16 |
false,for,function,goto,if,in,% |
| 17 |
local,nil,not,or,repeat,return,% |
| 18 |
then,true,until,while,% |
| 19 |
},% |
| 20 |
% standard library identifiers |
| 21 |
morekeywords=[2]{% |
| 22 |
% basic library |
| 23 |
assert,collectgarbage,dofile,error,_G,getmetatable,ipairs,% |
| 24 |
load,loadfile,next,pairs,pcall,print,rawequal,rawget,rawlen,rawset,% |
| 25 |
select,setmetatable,tonumber,tostring,type,_VERSION,xpcall,% |
| 26 |
% coroutine library |
| 27 |
coroutine.create,coroutine.resume,coroutine.running,% |
| 28 |
coroutine.status,coroutine.wrap,coroutine.yield,% |
| 29 |
% package library |
| 30 |
require,package.config,package.cpath,package.loaded,% |
| 31 |
package.loadlib,package.path,package.preload,package.searchers,% |
| 32 |
package.searchpath,% |
| 33 |
% string library |
| 34 |
string.byte,string.char,string.dump,string.find,string.format,% |
| 35 |
string.gmatch,string.gsub,string.len,string.lower,string.match,% |
| 36 |
string.rep,string.reverse,string.sub,string.upper,% |
| 37 |
% table library |
| 38 |
table.concat,table.insert,table.pack,table.remove,table.sort,% |
| 39 |
table.unpack,% |
| 40 |
% mathematical library |
| 41 |
math.abs,math.acos,math.asin,math.atan,math.atan2,math.ceil,% |
| 42 |
math.cos,math.cosh,math.deg,math.exp,math.floor,math.fmod,% |
| 43 |
math.frexp,math.huge,math.ldexp,math.log,math.max,math.min,% |
| 44 |
math.modf,math.pi,math.pow,math.rad,math.random,math.randomseed,% |
| 45 |
math.sin,math.sinh,math.sqrt,math.tan,math.tanh,% |
| 46 |
% bit library |
| 47 |
bit32.arshift,bit32.band,bit32.bnot,bit32.bor,bit32.btest,% |
| 48 |
bit32.bxor,bit32.extract,bit32.replace,bit32.lrotate,bit32.lshift,% |
| 49 |
bit32.rrotate,bit32.rshift,% |
| 50 |
% io library |
| 51 |
io.close,io.flush,io.input,io.lines,io.open,io.output,io.popen,% |
| 52 |
io.read,io.stderr,io.stdin,io.stdout,io.tmpfile,io.type,io.write,% |
| 53 |
% os library |
| 54 |
os.clock,os.date,os.difftime,os.execute,os.exit,os.getenv,% |
| 55 |
os.remove,os.rename,os.setlocale,os.time,os.tmpname,% |
| 56 |
% debug library |
| 57 |
debug.debug,debug.gethook,debug.getinfo,debug.getlocal,% |
| 58 |
debug.getmetatable,debug.getregistry,debug.getupvalue,% |
| 59 |
debug.getuservalue,debug.sethook,debug.setlocal,debug.setmetatable,% |
| 60 |
debug.setupvalue,debug.setuservalue,debug.traceback,% |
| 61 |
debug.upvalueid,debug.upvaluejoin,% |
| 62 |
},% |
| 63 |
% add environment |
| 64 |
morekeywords=[2]{_ENV},% |
| 65 |
% |
| 66 |
sensitive=true,% |
| 67 |
% single line comments |
| 68 |
morecomment=[l]{--},% |
| 69 |
% multi line comments |
| 70 |
morecomment=[s]{--[[}{]]},% |
| 71 |
morecomment=[s]{--[=[}{]=]},% |
| 72 |
morecomment=[s]{--[==[}{]==]},% |
| 73 |
morecomment=[s]{--[===[}{]===]},% |
| 74 |
% backslash escaped strings |
| 75 |
morestring=[b]",% |
| 76 |
morestring=[b]',% |
| 77 |
% multi line strings |
| 78 |
morestring=[s]{[[}{]]},% |
| 79 |
morestring=[s]{[=[}{]=]},% |
| 80 |
morestring=[s]{[==[}{]==]},% |
| 81 |
morestring=[s]{[===[}{]===]},% |
| 82 |
% labels |
| 83 |
moredelim=[s][keywordstyle3]{::}{::},% |
| 84 |
}[keywords,comments,strings]% |