o
    ‡ÎÖaQ   ã                   @   sâ   d Z ddddddddd	d
ddœZedkroddlZddlZeeejƒd ddƒD ]Zeje  	d¡r5eje= q'zddl
mZ W n eyM   ddlmZ Y nw ddlZdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zeƒ  dS dS ) a³  
    pygments.lexers._lua_builtins
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    This file contains the names and modules of lua functions
    It is able to re-generate itself, but for adding new functions you
    probably have to add some callbacks (see function module_callbacks).

    Do not edit the MODULES dict by hand.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
)Ú_GÚ_VERSIONÚassertÚcollectgarbageÚdofileÚerrorÚgetmetatableÚipairsÚloadÚloadfileÚnextÚpairsÚpcallÚprintÚrawequalÚrawgetÚrawlenÚrawsetÚselectÚsetmetatableÚtonumberÚtostringÚtypeÚxpcall)zbit32.arshiftz
bit32.bandz
bit32.bnotz	bit32.borzbit32.btestz
bit32.bxorzbit32.extractzbit32.lrotatezbit32.lshiftzbit32.replacezbit32.rrotatezbit32.rshift)zcoroutine.createzcoroutine.isyieldablezcoroutine.resumezcoroutine.runningzcoroutine.statuszcoroutine.wrapzcoroutine.yield)zdebug.debugzdebug.gethookzdebug.getinfozdebug.getlocalzdebug.getmetatablezdebug.getregistryzdebug.getupvaluezdebug.getuservaluezdebug.sethookzdebug.setlocalzdebug.setmetatablezdebug.setupvaluezdebug.setuservaluezdebug.tracebackzdebug.upvalueidzdebug.upvaluejoin)zio.closezio.flushzio.inputzio.lineszio.openz	io.outputzio.popenzio.readz	io.stderrzio.stdinz	io.stdoutz
io.tmpfilezio.typezio.write)"zmath.absz	math.acosz	math.asinz	math.atanz
math.atan2z	math.ceilzmath.cosz	math.coshzmath.degzmath.expz
math.floorz	math.fmodz
math.frexpz	math.hugez
math.ldexpzmath.logzmath.maxzmath.maxintegerzmath.minzmath.minintegerz	math.modfzmath.pizmath.powzmath.radzmath.randomzmath.randomseedzmath.sinz	math.sinhz	math.sqrtzmath.tanz	math.tanhzmath.tointegerz	math.typezmath.ult)	zpackage.configzpackage.cpathzpackage.loadedzpackage.loadlibzpackage.pathzpackage.preloadzpackage.searcherszpackage.searchpathÚrequire)zos.clockzos.datezos.difftimez
os.executezos.exitz	os.getenvz	os.removez	os.renamezos.setlocalezos.timez
os.tmpname)zstring.bytezstring.charzstring.dumpzstring.findzstring.formatzstring.gmatchzstring.gsubz
string.lenzstring.lowerzstring.matchzstring.packzstring.packsizez
string.repzstring.reversez
string.subzstring.unpackzstring.upper)ztable.concatztable.insertz
table.movez
table.packztable.removez
table.sortztable.unpack)z	utf8.charzutf8.charpatternzutf8.codepointz
utf8.codeszutf8.lenzutf8.offset)ÚbasicÚbit32Ú	coroutineÚdebugÚioÚmathÚmodulesÚosÚstringÚtableÚutf8Ú__main__é    Né   éÿÿÿÿz/lexers)Úurlopenc               	   C   sV   dd„ } dd„ }dd„ }dd„ }d	d
„ }dd„ }dd„ }dd„ }| |||||||dœS )Nc                 S   ó
   |   d¡S )Nz
coroutine.©Ú
startswith©Úname© r/   ú?/usr/lib/python3/dist-packages/pygments/lexers/_lua_builtins.pyÚis_in_coroutine_moduleÁ   ó   
z0module_callbacks.<locals>.is_in_coroutine_modulec                 S   s   | dv s	|   d¡rdS dS )N)r   ÚmoduleÚpackageTFr+   r-   r/   r/   r0   Úis_in_modules_moduleÄ   s   z.module_callbacks.<locals>.is_in_modules_modulec                 S   r*   )Nzstring.r+   r-   r/   r/   r0   Úis_in_string_moduleÊ   r2   z-module_callbacks.<locals>.is_in_string_modulec                 S   r*   )Nztable.r+   r-   r/   r/   r0   Úis_in_table_moduleÍ   r2   z,module_callbacks.<locals>.is_in_table_modulec                 S   r*   )Nr   r+   r-   r/   r/   r0   Úis_in_math_moduleÐ   r2   z+module_callbacks.<locals>.is_in_math_modulec                 S   r*   )Nzio.r+   r-   r/   r/   r0   Úis_in_io_moduleÓ   r2   z)module_callbacks.<locals>.is_in_io_modulec                 S   r*   )Nzos.r+   r-   r/   r/   r0   Úis_in_os_moduleÖ   r2   z)module_callbacks.<locals>.is_in_os_modulec                 S   r*   )Nzdebug.r+   r-   r/   r/   r0   Úis_in_debug_moduleÙ   r2   z,module_callbacks.<locals>.is_in_debug_module)r   r    r"   r#   r   r   r!   r   r/   )r1   r5   r6   r7   r8   r9   r:   r;   r/   r/   r0   Úmodule_callbacksÀ   s"   ùr<   c                  C   sB   t dƒ} t d¡}| D ]}| |¡}|d ur| ¡ d   S qd S )Nzhttp://www.lua.org/manual/z"^<A HREF="(\d\.\d)/">(Lua )?\1</A>r&   )r)   ÚreÚcompileÚmatchÚgroups)ÚfÚrÚlineÚmr/   r/   r0   Úget_newest_versionç   s   

ÿþrE   c                 C   sL   t d|  ƒ}t d¡}g }|D ]}| |¡}|d ur#| | ¡ d ¡ q|S )Nzhttp://www.lua.org/manual/%s/z4^<A HREF="manual.html#pdf-(?!lua|LUA)([^:]+)">\1</A>r&   )r)   r=   r>   r?   Úappendr@   )ÚversionrA   rB   Ú	functionsrC   rD   r/   r/   r0   Úget_lua_functionsï   s   

€rI   c                 C   s>   t ƒ  ¡ D ]\}}|| ƒr|  S qd| v r|  d¡d S dS )NÚ.r&   r   )r<   ÚitemsÚsplit)r.   ÚmodÚcbr/   r/   r0   Úget_function_moduleù   s   ÿrO   c                 C   s¬   t | ƒ�}| ¡ }W d   ƒ n1 sw   Y  |d | d¡… }|| d¡d … }t | dƒ�}| |¡ | dt |¡ ¡ | |¡ W d   ƒ d S 1 sOw   Y  d S )NzMODULES = {zif __name__ == '__main__':ÚwzMODULES = %s

)ÚopenÚreadÚfindÚwriteÚpprintÚpformat)Úfilenamer    ÚfpÚcontentÚheaderÚfooterr/   r/   r0   Ú
regenerate  s   

ÿ
"ýr\   c                  C   s¶   t ƒ } tƒ }d| fD ]"}td| ƒ t|ƒ}tdt|ƒtt|ƒ| ƒf ƒ |t|ƒO }q
t|ƒ}i }|D ]}td| ƒ t|ƒ}| |g ¡ |¡ q5dd„ | 	¡ D ƒ}t
t|ƒ d S )Nz5.2z'> Downloading function index for Lua %sz> %d functions found, %d new:z>> %sc                 S   s   i | ]	\}}|t |ƒ“qS r/   )Útuple)Ú.0ÚkÚvr/   r/   r0   Ú
<dictcomp>   s    zrun.<locals>.<dictcomp>)rE   Úsetr   rI   ÚlenÚsortedrO   Ú
setdefaultrF   rK   r\   Ú__file__)rG   rH   r`   rA   r    Úfull_function_namerD   r/   r/   r0   Úrun  s"   ÿrh   )Ú__doc__ÚMODULESÚ__name__r=   ÚsysÚrangerc   ÚpathÚiÚendswithÚurllibr)   ÚImportErrorÚurllib.requestrU   r<   rE   rI   rO   r\   rh   r/   r/   r/   r0   Ú<module>   sH    "	 �è €ÿ'
	
‰