3

V'ícÚã@s6dZddlZdgZejdejƒZdd„Zd	dd„ZdS)
    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]+ )
cCstj|ƒ}|r|jdƒSdS)Né)Úmodeline_reÚsearchÚgroup)ÚlÚm©r	ú5/tmp/pip-build-gk9425m9/Pygments/pygments/modeline.pyÚget_filetype_from_lines
récCsp|jƒ}x,|d|dd…D]}t|ƒ}|r|SqWx4t|ddƒD]$}|t|ƒkrDt||ƒ}|rD|SqDWdS)zL
    Scan the buffer for modelines and return filetype if one is found.
    rNéÿÿÿÿr
r
r
)Ú
splitlinesrÚrangeÚlen)ÚbufÚ	max_linesÚlinesrÚretÚir	r	r
rs)r)Ú__doc__ÚreÚ__all__ÚcompileÚVERBOSErrrr	r	r	r
Ú<module>	s