U
    yc                     @   s6   d Z ddlZdgZedejZdd Zd	ddZdS )
z
    pygments.modeline
    ~~~~~~~~~~~~~~~~~

    A simple modeline parser (based on pymodeline).

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    Nget_filetype_from_bufferze
    (?: vi | vim | ex ) (?: [<=>]? \d* )? :
    .* (?: ft | filetype | syn | syntax ) = ( [^:\s]+ )
c                 C   s   t | }|r|dS d S )N   )modeline_researchgroup)lm r	   </tmp/pip-build-0we0fmvo/pip/pip/_vendor/pygments/modeline.pyget_filetype_from_line   s    
r      c                 C   sp   |   }|d| d d D ]}t|}|r|  S qt|ddD ](}|t|k rBt|| }|rB|  S qBdS )zL
    Scan the buffer for modelines and return filetype if one is found.
    r   N)
splitlinesr   rangelen)buf	max_lineslinesr   retir	   r	   r
   r      s    

)r   )__doc__re__all__compileVERBOSEr   r   r   r	   r	   r	   r
   <module>   s   
