ó
l2RTc           @   sI   d  Z  d d l Z d g Z e j d e j  Z d   Z d d  Z d S(   sÖ   
    pygments.modeline
    ~~~~~~~~~~~~~~~~~

    A simple modeline parser (based on pymodeline).

    :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
i˙˙˙˙Nt   get_filetype_from_bufferse   
    (?: vi | vim | ex ) (?: [<=>]? \d* )? :
    .* (?: ft | filetype | syn | syntax ) = ( [^:\s]+ )
c         C   s&   t  j |   } | r" | j d  Sd  S(   Ni   (   t   modeline_ret   searcht   group(   t   lt   m(    (    s5   /usr/lib/python2.7/dist-packages/pygments/modeline.pyt   get_filetype_from_line   s    i   c         C   s}   |  j    } x6 | d | d d  D] } t |  } | r% | Sq% Wx1 | | d d  D] } t |  } | rY | SqY Wd S(   sL   
    Scan the buffer for modelines and return filetype if one is found.
    i˙˙˙˙i   i    N(   t
   splitlinesR   t   None(   t   buft	   max_linest   linesR   t   ret(    (    s5   /usr/lib/python2.7/dist-packages/pygments/modeline.pyR       s    (   t   __doc__t   ret   __all__t   compilet   VERBOSER   R   R    (    (    (    s5   /usr/lib/python2.7/dist-packages/pygments/modeline.pyt   <module>
   s   		