summaryrefslogtreecommitdiff
path: root/pygments/lexers/_lua_builtins.py
diff options
context:
space:
mode:
authorDavid Corbett <corbett.dav@husky.neu.edu>2016-03-21 16:28:50 -0400
committerDavid Corbett <corbett.dav@husky.neu.edu>2016-03-21 16:28:50 -0400
commit3754b29cbb08de34a06c6803df7d049e466cafec (patch)
treee06a8b6f6e009805bdaae71f35c43ba5ff293d29 /pygments/lexers/_lua_builtins.py
parentce93b89a0b9d6b3b0eb828e049952c4ff84421fd (diff)
downloadpygments-3754b29cbb08de34a06c6803df7d049e466cafec.tar.gz
Improve LuaLexer
Diffstat (limited to 'pygments/lexers/_lua_builtins.py')
-rw-r--r--pygments/lexers/_lua_builtins.py60
1 files changed, 36 insertions, 24 deletions
diff --git a/pygments/lexers/_lua_builtins.py b/pygments/lexers/_lua_builtins.py
index 6d2929b6..14d80d19 100644
--- a/pygments/lexers/_lua_builtins.py
+++ b/pygments/lexers/_lua_builtins.py
@@ -22,47 +22,47 @@ MODULES = {'basic': ('_G',
'collectgarbage',
'dofile',
'error',
- 'getfenv',
'getmetatable',
'ipairs',
'load',
'loadfile',
- 'loadstring',
'next',
'pairs',
'pcall',
'print',
'rawequal',
'rawget',
+ 'rawlen',
'rawset',
'select',
- 'setfenv',
'setmetatable',
'tonumber',
'tostring',
'type',
- 'unpack',
'xpcall'),
'coroutine': ('coroutine.create',
+ 'coroutine.isyieldable',
'coroutine.resume',
'coroutine.running',
'coroutine.status',
'coroutine.wrap',
'coroutine.yield'),
'debug': ('debug.debug',
- 'debug.getfenv',
'debug.gethook',
'debug.getinfo',
'debug.getlocal',
'debug.getmetatable',
'debug.getregistry',
'debug.getupvalue',
- 'debug.setfenv',
+ 'debug.getuservalue',
'debug.sethook',
'debug.setlocal',
'debug.setmetatable',
'debug.setupvalue',
- 'debug.traceback'),
+ 'debug.setuservalue',
+ 'debug.traceback',
+ 'debug.upvalueid',
+ 'debug.upvaluejoin'),
'io': ('io.close',
'io.flush',
'io.input',
@@ -71,47 +71,48 @@ MODULES = {'basic': ('_G',
'io.output',
'io.popen',
'io.read',
+ 'io.stderr',
+ 'io.stdin',
+ 'io.stdout',
'io.tmpfile',
'io.type',
'io.write'),
'math': ('math.abs',
'math.acos',
'math.asin',
- 'math.atan2',
'math.atan',
'math.ceil',
- 'math.cosh',
'math.cos',
'math.deg',
'math.exp',
'math.floor',
'math.fmod',
- 'math.frexp',
'math.huge',
- 'math.ldexp',
- 'math.log10',
'math.log',
'math.max',
+ 'math.maxinteger',
'math.min',
+ 'math.mininteger',
'math.modf',
'math.pi',
- 'math.pow',
'math.rad',
'math.random',
'math.randomseed',
- 'math.sinh',
'math.sin',
'math.sqrt',
- 'math.tanh',
- 'math.tan'),
- 'modules': ('module',
- 'require',
+ 'math.tan',
+ 'math.tointeger',
+ 'math.type',
+ 'math.ult'),
+ 'modules': ('require',
+ 'package.config',
'package.cpath',
'package.loaded',
'package.loadlib',
'package.path',
'package.preload',
- 'package.seeall'),
+ 'package.searchers',
+ 'package.searchpath'),
'os': ('os.clock',
'os.date',
'os.difftime',
@@ -133,16 +134,26 @@ MODULES = {'basic': ('_G',
'string.len',
'string.lower',
'string.match',
+ 'string.pack',
+ 'string.packsize',
'string.rep',
'string.reverse',
'string.sub',
+ 'string.unpack',
'string.upper'),
'table': ('table.concat',
'table.insert',
- 'table.maxn',
+ 'table.move',
+ 'table.pack',
'table.remove',
- 'table.sort')}
-
+ 'table.sort',
+ 'table.unpack'),
+ 'utf8': ('utf8.char',
+ 'utf8.charpattern',
+ 'utf8.codepoint',
+ 'utf8.codes',
+ 'utf8.len',
+ 'utf8.offset')}
if __name__ == '__main__': # pragma: no cover
import re
@@ -196,7 +207,7 @@ if __name__ == '__main__': # pragma: no cover
def get_newest_version():
f = urlopen('http://www.lua.org/manual/')
- r = re.compile(r'^<A HREF="(\d\.\d)/">Lua \1</A>')
+ r = re.compile(r'^<A HREF="(\d\.\d)/">(Lua )?\1</A>')
for line in f:
m = r.match(line)
if m is not None:
@@ -204,7 +215,7 @@ if __name__ == '__main__': # pragma: no cover
def get_lua_functions(version):
f = urlopen('http://www.lua.org/manual/%s/' % version)
- r = re.compile(r'^<A HREF="manual.html#pdf-(.+)">\1</A>')
+ r = re.compile(r'^<A HREF="manual.html#pdf-(?!lua|LUA)([^:]+)">\1</A>')
functions = []
for line in f:
m = r.match(line)
@@ -245,6 +256,7 @@ if __name__ == '__main__': # pragma: no cover
print('>> %s' % full_function_name)
m = get_function_module(full_function_name)
modules.setdefault(m, []).append(full_function_name)
+ modules = {k: tuple(v) for k, v in modules.iteritems()}
regenerate(__file__, modules)