o
    Ñ­j  ã                   @   s€   d Z ddlZddlmZmZ ddlmZmZmZm	Z	 ddl
mZ g d¢ZG dd„ deƒZG d	d
„ d
eƒZi ZG dd„ deƒZdS )zÅ
    pygments.lexers.special
    ~~~~~~~~~~~~~~~~~~~~~~~

    Special lexers.

    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)ÚLexerÚline_re)ÚTokenÚErrorÚTextÚGeneric)Úget_choice_opt)Ú	TextLexerÚOutputLexerÚRawTokenLexerc                   @   sB   e Zd ZdZdZdgZdgZdgZdZdZ	dZ
dd	„ Zd
d„ ZdS )r	   z3
    "Null" lexer, doesn't highlight anything.
    z	Text onlyÚtextz*.txtz
text/plainÚ g{®Gáz„?c                 c   s   � dt |fV  d S ©Nr   )r   ©Úselfr   © r   úT/var/www/html/CropPilot/venv/lib/python3.10/site-packages/pygments/lexers/special.pyÚget_tokens_unprocessed"   s   €z TextLexer.get_tokens_unprocessedc                 C   s   t jS )N)r	   Úpriority)r   r   r   r   Úanalyse_text%   s   zTextLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesÚurlÚversion_addedr   r   r   r   r   r   r   r	      s    r	   c                   @   s.   e Zd ZdZdZdgZdZdZdZdd„ Z	d	S )
r
   zN
    Simple lexer that highlights everything as ``Token.Generic.Output``.
    zText outputÚoutputr   z2.10zoutput/outputc                 c   s   � dt j|fV  d S r   )r   ÚOutputr   r   r   r   r   3   s   €z"OutputLexer.get_tokens_unprocessedN)
r   r   r   r   r   r   r   r   Ú_exampler   r   r   r   r   r
   )   s    r
   c                   @   sB   e Zd ZdZdZg Zg ZdgZdZdZ	dd„ Z
dd	„ Zd
d„ ZdS )r   a  
    Recreate a token stream formatted with the `RawTokenFormatter`.

    Additional options accepted:

    `compress`
        If set to ``"gz"`` or ``"bz2"``, decompress the token stream with
        the given compression algorithm before lexing (default: ``""``).
    zRaw token datazapplication/x-pygments-tokensz7https://pygments.org/docs/formatters/#RawTokenFormatterr   c                 K   s*   t |dg d¢dƒ| _tj| fi |¤Ž d S )NÚcompress)r   ÚnoneÚgzÚbz2r   )r   r#   r   Ú__init__)r   Úoptionsr   r   r   r'   K   s   ÿzRawTokenLexer.__init__c                 c   sÄ   � | j r?t|tƒr| d¡}z| j dkrdd l}| |¡}n| j dkr,dd l}| |¡}W n ty>   t| 	d¡fV  Y nw t|t
ƒrI| 	d¡}| d¡d }|  |¡D ]
\}}}||fV  qUd S )NÚlatin1r%   r   r&   Ú
)r#   Ú
isinstanceÚstrÚencodeÚgzipÚ
decompressr&   ÚOSErrorr   ÚdecodeÚbytesÚstripr   )r   r   r.   r&   ÚiÚtÚvr   r   r   Ú
get_tokensP   s*   €




€ÿ

ÿzRawTokenLexer.get_tokensc           	   
   c   sæ   � d}t  |¡D ]h}zH| ¡  ¡  dd¡\}}t |¡}|sCt}| d¡dd … }|D ]}|r5|d  ¡ s9t	dƒ‚t
||ƒ}q+|t|< t |¡}t|tƒsQt	dƒ‚W n tt	fyc   | ¡ }t}Y nw |||fV  |t|ƒ7 }qd S )Nr   ú	é   Ú.zmalformed token namezexpected str)r   ÚfinditerÚgroupÚrstripÚsplitÚ_ttype_cacheÚgetr   ÚisupperÚ
ValueErrorÚgetattrÚastÚliteral_evalr+   r,   ÚSyntaxErrorr   Úlen)	r   r   ÚlengthÚmatchÚttypestrÚvalÚttypeÚttypesÚttype_r   r   r   r   e   s2   €


ÿþíz$RawTokenLexer.get_tokens_unprocessedN)r   r   r   r   r   r   r   r   r   r   r'   r7   r   r   r   r   r   r   :   s    	r   )r   rD   Úpygments.lexerr   r   Úpygments.tokenr   r   r   r   Úpygments.utilr   Ú__all__r	   r
   r?   r   r   r   r   r   Ú<module>   s    
