
l2RTc           @  s   d  Z  d d l m Z i	 d d 6d d% 6d d4 6d d@ 6d d_ 6d dh 6d dt 6d d 6d d 6Z e d k r d d l Z y d d l m Z Wn! e k
 r d d l	 m Z n Xd d l
 Z
 d   Z d   Z d   Z d   Z d   Z d   Z e   n  d S(   s  
    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-2014 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
i(   t   print_functiont   _Gt   _VERSIONt   assertt   collectgarbaget   dofilet   errort   getfenvt   getmetatablet   ipairst   loadt   loadfilet
   loadstringt   nextt   pairst   pcallt   printt   rawequalt   rawgett   rawsett   selectt   setfenvt   setmetatablet   tonumbert   tostringt   typet   unpackt   xpcallt   basics   coroutine.creates   coroutine.resumes   coroutine.runnings   coroutine.statuss   coroutine.wraps   coroutine.yieldt	   coroutines   debug.debugs   debug.getfenvs   debug.gethooks   debug.getinfos   debug.getlocals   debug.getmetatables   debug.getregistrys   debug.getupvalues   debug.setfenvs   debug.sethooks   debug.setlocals   debug.setmetatables   debug.setupvalues   debug.tracebackt   debugs   io.closes   io.flushs   io.inputs   io.liness   io.opens	   io.outputs   io.popens   io.reads
   io.tmpfiles   io.types   io.writet   ios   math.abss	   math.acoss	   math.asins
   math.atan2s	   math.atans	   math.ceils	   math.coshs   math.coss   math.degs   math.exps
   math.floors	   math.fmods
   math.frexps	   math.huges
   math.ldexps
   math.log10s   math.logs   math.maxs   math.mins	   math.modfs   math.pis   math.pows   math.rads   math.randoms   math.randomseeds	   math.sinhs   math.sins	   math.sqrts	   math.tanhs   math.tant   matht   modulet   requires   package.cpaths   package.loadeds   package.loadlibs   package.paths   package.preloads   package.seeallt   moduless   os.clocks   os.dates   os.difftimes
   os.executes   os.exits	   os.getenvs	   os.removes	   os.renames   os.setlocales   os.times
   os.tmpnamet   oss   string.bytes   string.chars   string.dumps   string.finds   string.formats   string.gmatchs   string.gsubs
   string.lens   string.lowers   string.matchs
   string.reps   string.reverses
   string.subs   string.uppert   strings   table.concats   table.inserts
   table.maxns   table.removes
   table.sortt   tablet   __main__N(   t   urlopenc          C  s   d   }  d   } d   } d   } d   } d   } d   } d   } i |  d	 6| d
 6| d 6| d 6| d 6| d 6| d 6| d 6S(   Nc         S  s   |  j  d  S(   Ns
   coroutine.(   t
   startswith(   t   name(    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   is_in_coroutine_module   s    c         S  s'   |  d k s |  j  d  r t St Sd  S(   NR"   R!   t   package(   R"   s   module(   R)   t   Truet   False(   R*   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   is_in_modules_module   s    c         S  s   |  j  d  S(   Ns   string.(   R)   (   R*   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   is_in_string_module   s    c         S  s   |  j  d  S(   Ns   table.(   R)   (   R*   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   is_in_table_module   s    c         S  s   |  j  d  S(   NR    (   R)   (   R*   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   is_in_math_module   s    c         S  s   |  j  d  S(   Ns   io.(   R)   (   R*   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   is_in_io_module   s    c         S  s   |  j  d  S(   Ns   os.(   R)   (   R*   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   is_in_os_module   s    c         S  s   |  j  d  S(   Ns   debug.(   R)   (   R*   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   is_in_debug_module   s    R   R#   R%   R&   R    R   R$   R   (    (   R+   R/   R0   R1   R2   R3   R4   R5   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   module_callbacks   s     								
c          C  sY   t  d  }  t j d  } x7 |  D]/ } | j |  } | d  k	 r" | j   d Sq" Wd  S(   Ns   http://www.lua.org/manual/s   ^<A HREF="(\d\.\d)/">Lua \1</A>i    (   R(   t   ret   compilet   matcht   Nonet   groups(   t   ft   rt   linet   m(    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   get_newest_version   s    c         C  so   t  d |   } t j d  } g  } xC | D]; } | j |  } | d  k	 r, | j | j   d  q, q, W| S(   Ns   http://www.lua.org/manual/%s/s&   ^<A HREF="manual.html#pdf-(.+)">\1</A>i    (   R(   R7   R8   R9   R:   t   appendR;   (   t   versionR<   R=   t	   functionsR>   R?   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   get_lua_functions   s    c         C  sU   x- t    j   D] \ } } | |   r | Sq Wd |  k rM |  j d  d Sd Sd  S(   Nt   .i    R   (   R6   t   itemst   split(   R*   t   modt   cb(    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   get_function_module   s    c      	   C  s   t  |    } | j   } Wd  QX| | j d   } | | j d  } t  |  d  ; } | j |  | j d t j |   | j |  Wd  QXd  S(   Ns   MODULES = {s   if __name__ == '__main__':t   ws   MODULES = %s

(   t   opent   readt   findt   writet   pprintt   pformat(   t   filenameR#   t   fpt   contentt   headert   footer(    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt
   regenerate   s    c          C  s   t    }  t d |   t |   } t d t |   i  } xA | D]9 } t d |  t |  } | j | g   j |  qD Wt t |  d  S(   Ns'   > Downloading function index for Lua %ss   > %d functions found:s   >> %s(	   R@   R   RD   t   lenRJ   t
   setdefaultRA   RW   t   __file__(   RB   RC   R#   t   full_function_nameR?   (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   run   s    	(   R   R   s   assertR   R   s   errorR   R   R	   s   loadR   R   s   nextR   R   s   printR   R   R   R   R   R   R   R   s   typeR   R   (   s   coroutine.creates   coroutine.resumes   coroutine.runnings   coroutine.statuss   coroutine.wraps   coroutine.yield(   s   debug.debugs   debug.getfenvs   debug.gethooks   debug.getinfos   debug.getlocals   debug.getmetatables   debug.getregistrys   debug.getupvalues   debug.setfenvs   debug.sethooks   debug.setlocals   debug.setmetatables   debug.setupvalues   debug.traceback(   s   io.closes   io.flushs   io.inputs   io.liness   io.opens	   io.outputs   io.popens   io.reads
   io.tmpfiles   io.types   io.write(   s   math.abss	   math.acoss	   math.asins
   math.atan2s	   math.atans	   math.ceils	   math.coshs   math.coss   math.degs   math.exps
   math.floors	   math.fmods
   math.frexps	   math.huges
   math.ldexps
   math.log10s   math.logs   math.maxs   math.mins	   math.modfs   math.pis   math.pows   math.rads   math.randoms   math.randomseeds	   math.sinhs   math.sins	   math.sqrts	   math.tanhs   math.tan(   s   modules   requires   package.cpaths   package.loadeds   package.loadlibs   package.paths   package.preloads   package.seeall(   s   os.clocks   os.dates   os.difftimes
   os.executes   os.exits	   os.getenvs	   os.removes	   os.renames   os.setlocales   os.times
   os.tmpname(   s   string.bytes   string.chars   string.dumps   string.finds   string.formats   string.gmatchs   string.gsubs
   string.lens   string.lowers   string.matchs
   string.reps   string.reverses
   string.subs   string.upper(   s   table.concats   table.inserts
   table.maxns   table.removes
   table.sort(   t   __doc__t
   __future__R    t   MODULESt   __name__R7   t   urllibR(   t   ImportErrort   urllib.requestRP   R6   R@   RD   RJ   RW   R\   (    (    (    sA   /usr/lib/python2.7/dist-packages/pygments/lexers/_lua_builtins.pyt   <module>   s                                                                                                                      
	'		
				