o
    3Ih                     @   s   d Z ddddddddd	d
ddZedkr?ddlZddlmZ 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.

    Run with `python -I` to regenerate.

    :copyright: Copyright 2006-2025 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warn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.closez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)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.   ]/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-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.   r/   is_in_modules_module   s   z.module_callbacks.<locals>.is_in_modules_modulec                 S   r)   )Nzstring.r*   r,   r.   r.   r/   is_in_string_module   r1   z-module_callbacks.<locals>.is_in_string_modulec                 S   r)   )Nztable.r*   r,   r.   r.   r/   is_in_table_module   r1   z,module_callbacks.<locals>.is_in_table_modulec                 S   r)   )Nr    r*   r,   r.   r.   r/   is_in_math_module   r1   z+module_callbacks.<locals>.is_in_math_modulec                 S   r)   )Nzio.r*   r,   r.   r.   r/   is_in_io_module   r1   z)module_callbacks.<locals>.is_in_io_modulec                 S   r)   )Nzos.r*   r,   r.   r.   r/   is_in_os_module   r1   z)module_callbacks.<locals>.is_in_os_modulec                 S   r)   )Nzdebug.r*   r,   r.   r.   r/   is_in_debug_module   r1   z,module_callbacks.<locals>.is_in_debug_module)r   r!   r#   r$   r    r   r"   r   r.   )r0   r4   r5   r6   r7   r8   r9   r:   r.   r.   r/   module_callbacks   s"   r;   c                  C   sH   t d} td}| D ]}||d}|d ur!| d   S qd S )Nhttp://www.lua.org/manual/z"^<A HREF="(\d\.\d)/">(Lua )?\1</A>
iso-8859-1r'   )r(   recompilematchdecodegroups)frlinemr.   r.   r/   get_newest_version   s   
rG   c                 C   sV   t d|  d}td}g }|D ]}||d}|d ur(|| d  q|S )Nr<   /z4^<A HREF="manual.html#pdf-(?!lua|LUA)([^:]+)">\1</A>r=   r'   )r(   r>   r?   r@   rA   appendrB   )versionrC   rD   	functionsrE   rF   r.   r.   r/   get_lua_functions   s   
rL   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.   r/   get_function_module   s   rR   c                 C   s   t | dd}| }W d    n1 sw   Y  |d |d }||dd  }t | ddd}|| |dt| d || W d    d S 1 sUw   Y  d S )Nzutf-8)encodingzMODULES = {zif __name__ == '__main__':wz
MODULES = z

)openreadfindwritepprintpformat)filenamer!   fpcontentheaderfooterr.   r.   r/   
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 | q6dd |	 D }t
t| d S )Nz5.2z%> Downloading function index for Lua z> %d functions found, %d new:z>> c                 S   s   i | ]	\}}|t |qS r.   )tuple).0kvr.   r.   r/   
<dictcomp>  s    zrun.<locals>.<dictcomp>)rG   setr   rL   lensortedrR   
setdefaultrI   rN   r`   __file__)rJ   rK   rd   rC   r!   full_function_namerF   r.   r.   r/   run  s"   rl   )__doc__MODULES__name__r>   urllib.requestr(   rY   r;   rG   rL   rR   r`   rl   r.   r.   r.   r/   <module>   s6    "	  !'
	
