diff options
author | Georg Brandl <georg@python.org> | 2022-01-29 06:52:15 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2022-01-29 06:52:15 +0100 |
commit | 7e68d4b23b275a56069d989d7ed8d07528ba42ae (patch) | |
tree | fcaf6bcf9476fc3abce3444e7b886272312faa22 /pygments/lexers/_lua_builtins.py | |
parent | fc2b6a4577372a3399efb873f8dca8152c0fc6d6 (diff) | |
download | pygments-git-7e68d4b23b275a56069d989d7ed8d07528ba42ae.tar.gz |
lua: fix builtin regenerate script and update
Diffstat (limited to 'pygments/lexers/_lua_builtins.py')
-rw-r--r-- | pygments/lexers/_lua_builtins.py | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/pygments/lexers/_lua_builtins.py b/pygments/lexers/_lua_builtins.py index d4b52904..08bcfb17 100644 --- a/pygments/lexers/_lua_builtins.py +++ b/pygments/lexers/_lua_builtins.py @@ -8,6 +8,8 @@ Do not edit the MODULES dict by hand. + Run with `python -I` to regenerate. + :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -35,6 +37,7 @@ MODULES = {'basic': ('_G', 'tonumber', 'tostring', 'type', + 'warn', 'xpcall'), 'bit32': ('bit32.arshift', 'bit32.band', @@ -48,7 +51,8 @@ MODULES = {'basic': ('_G', 'bit32.replace', 'bit32.rrotate', 'bit32.rshift'), - 'coroutine': ('coroutine.create', + 'coroutine': ('coroutine.close', + 'coroutine.create', 'coroutine.isyieldable', 'coroutine.resume', 'coroutine.running', @@ -173,17 +177,7 @@ MODULES = {'basic': ('_G', if __name__ == '__main__': # pragma: no cover import re import sys - - # urllib ends up wanting to import a module called 'math' -- if - # pygments/lexers is in the path, this ends badly. - for i in range(len(sys.path)-1, -1, -1): - if sys.path[i].endswith('/lexers'): - del sys.path[i] - - try: - from urllib import urlopen - except ImportError: - from urllib.request import urlopen + from urllib.request import urlopen import pprint # you can't generally find out what module a function belongs to if you @@ -232,7 +226,7 @@ if __name__ == '__main__': # pragma: no cover f = urlopen('http://www.lua.org/manual/') r = re.compile(r'^<A HREF="(\d\.\d)/">(Lua )?\1</A>') for line in f: - m = r.match(line) + m = r.match(line.decode('iso-8859-1')) if m is not None: return m.groups()[0] @@ -241,7 +235,7 @@ if __name__ == '__main__': # pragma: no cover r = re.compile(r'^<A HREF="manual.html#pdf-(?!lua|LUA)([^:]+)">\1</A>') functions = [] for line in f: - m = r.match(line) + m = r.match(line.decode('iso-8859-1')) if m is not None: functions.append(m.groups()[0]) return functions |