3
V'ícÚ ã @ s6 d Z ddlZdgZejdejZdd Zd ddZdS )
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 j| }|r|jdS d S )Né )Úmodeline_reÚsearchÚgroup)ÚlÚm© r ú5/tmp/pip-build-gk9425m9/Pygments/pygments/modeline.pyÚget_filetype_from_line s
r é c C sp | j }x,|d| d d
D ]}t|}|r|S qW x4t|ddD ]$}|t|k rDt|| }|rD|S qDW dS )zL
Scan the buffer for modelines and return filetype if one is found.
r Néÿÿÿÿr