Ë
    äØjj:‡  ã                   óX  — d Z ddlZddlZddlZddlmZmZ ddlmZ ddl	m
Z
mZmZmZmZ ddlmZmZmZmZmZmZ ddlmZ g d¢Z ej2                  d	«      Zg d
¢Z ed„ «      Z G d„ de«      Z G d„ de¬«      Z  G d„ de «      Z! G d„ de"«      Z# G d„ d«      Z$ e$«       Z% G d„ de&«      Z' G d„ d«      Z(d„ Z) G d„ d«      Z* e*«       Z+d„ Z, G d„ d «      Z- G d!„ d"e«      Z. G d#„ d$e«      Z/ G d%„ d&e e/¬«      Z0 G d'„ d(«      Z1 G d)„ d*e0«      Z2d+„ Z3 G d,„ d-e/«      Z4 G d.„ d/e0e4¬«      Z5y)0z´
    pygments.lexer
    ~~~~~~~~~~~~~~

    Base lexer classes.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)Úapply_filtersÚFilter)Úget_filter_by_name)ÚErrorÚTextÚOtherÚ
WhitespaceÚ
_TokenType)Úget_bool_optÚget_int_optÚget_list_optÚmake_analysatorÚFutureÚguess_decode)Ú	regex_opt)ÚLexerÚ
RegexLexerÚExtendedRegexLexerÚDelegatingLexerÚLexerContextÚincludeÚinheritÚbygroupsÚusingÚthisÚdefaultÚwordsÚline_rez.*?
))s   ï»¿úutf-8)s   ÿþ  zutf-32)s     þÿzutf-32be)s   ÿþzutf-16)s   þÿzutf-16bec                  ó   — y)Nç        © )Úxs    ú\/opt/eval-harness/bench_task/venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexer.pyú<lambda>r%   "   ó   � ó    c                   ó   — e Zd ZdZd„ Zy)Ú	LexerMetaz‚
    This metaclass automagically converts ``analyse_text`` methods into
    static methods which always return float values.
    c                 ó\   — d|v rt        |d   «      |d<   t        j                  | |||«      S )NÚanalyse_text)r   ÚtypeÚ__new__)ÚmcsÚnameÚbasesÚds       r$   r-   zLexerMeta.__new__+   s3   € Ø˜QÑÜ /°°.Ñ0AÓ BˆAˆnÑÜ�|‰|˜C  u¨aÓ0Ð0r'   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r-   r"   r'   r$   r)   r)   %   s   „ ñó
1r'   r)   c                   óR   — e Zd ZdZdZg Zg Zg Zg ZdZ	dZ
d„ Zd„ Zd„ Zd„ Zd
d„Zd	„ Zy)r   au  
    Lexer for a specific language.

    See also :doc:`lexerdevelopment`, a high-level guide to writing
    lexers.

    Lexer classes have attributes used for choosing the most appropriate
    lexer based on various criteria.

    .. autoattribute:: name
       :no-value:
    .. autoattribute:: aliases
       :no-value:
    .. autoattribute:: filenames
       :no-value:
    .. autoattribute:: alias_filenames
    .. autoattribute:: mimetypes
       :no-value:
    .. autoattribute:: priority

    Lexers included in Pygments should have an additional attribute:

    .. autoattribute:: url
       :no-value:

    You can pass options to the constructor. The basic options recognized
    by all lexers and processed by the base `Lexer` class are:

    ``stripnl``
        Strip leading and trailing newlines from the input (default: True).
    ``stripall``
        Strip all leading and trailing whitespace from the input
        (default: False).
    ``ensurenl``
        Make sure that the input ends with a newline (default: True).  This
        is required for some lexers that consume input linewise.

        .. versionadded:: 1.3

    ``tabsize``
        If given and greater than 0, expand tabs in the input (default: 0).
    ``encoding``
        If given, must be an encoding name. This encoding will be used to
        convert the input string to Unicode, if it is not already a Unicode
        string (default: ``'guess'``, which uses a simple UTF-8 / Locale /
        Latin1 detection.  Can also be ``'chardet'`` to use the chardet
        library, if it is installed.
    ``inencoding``
        Overrides the ``encoding`` if given.
    Nr   c                 ól  — || _         t        |dd«      | _        t        |dd«      | _        t        |dd«      | _        t        |dd«      | _        |j                  dd	«      | _        |j                  d
«      xs | j                  | _        g | _	        t        |dd«      D ]  }| j                  |«       Œ y)a‘  
        This constructor takes arbitrary options as keyword arguments.
        Every subclass must first process its own options and then call
        the `Lexer` constructor, since it processes the basic
        options like `stripnl`.

        An example looks like this:

        .. sourcecode:: python

           def __init__(self, **options):
               self.compress = options.get('compress', '')
               Lexer.__init__(self, **options)

        As these options must all be specifiable as strings (due to the
        command line usage), there are various utility functions
        available to help with that, see `Utilities`_.
        ÚstripnlTÚstripallFÚensurenlÚtabsizer   ÚencodingÚguessÚ
inencodingÚfiltersr"   N)Úoptionsr   r8   r9   r:   r   r;   Úgetr<   r?   r   Ú
add_filter)Úselfr@   Úfilter_s      r$   Ú__init__zLexer.__init__ƒ   s¡   € ð& ˆŒÜ# G¨Y¸Ó=ˆŒÜ$ W¨j¸%Ó@ˆŒÜ$ W¨j¸$Ó?ˆŒÜ" 7¨I°qÓ9ˆŒØŸ™ J°Ó8ˆŒØŸ™ LÓ1ÒB°T·]±]ˆŒØˆŒÜ# G¨Y¸Ó;ò 	%ˆGØ�O‰O˜GÕ$ñ	%r'   c                 óš   — | j                   r'd| j                  j                  ›d| j                   ›d�S d| j                  j                  z  S )Nz<pygments.lexers.z with ú>z<pygments.lexers.%s>)r@   Ú	__class__r2   ©rC   s    r$   Ú__repr__zLexer.__repr__¡   s@   € Ø�<‹<Ø59·^±^×5LÓ5LØ59·\³\ðCð Cð *¨D¯N©N×,CÑ,CÑCÐCr'   c                 ór   — t        |t        «      st        |fi |¤Ž}| j                  j	                  |«       y)z8
        Add a new stream filter to this lexer.
        N)Ú
isinstancer   r   r?   Úappend)rC   rD   r@   s      r$   rB   zLexer.add_filter¨   s/   € ô ˜'¤6Ô*Ü(¨Ñ<°GÑ<ˆGØ�‰×Ñ˜GÕ$r'   c                  ó   — y)aÁ  
        A static method which is called for lexer guessing.

        It should analyse the text and return a float in the range
        from ``0.0`` to ``1.0``.  If it returns ``0.0``, the lexer
        will not be selected as the most probable one, if it returns
        ``1.0``, it will be selected immediately.  This is used by
        `guess_lexer`.

        The `LexerMeta` metaclass automatically wraps this function so
        that it works like a static method (no ``self`` or ``cls``
        parameter) and the return value is automatically converted to
        `float`. If the return value is an object that is boolean `False`
        it's the same as if the return values was ``0.0``.
        Nr"   )Útexts    r$   r+   zLexer.analyse_text°   r&   r'   c                 ó  ‡ ‡— t        ‰t        «      sî‰ j                  dk(  rt        ‰«      \  Š}nï‰ j                  dk(  r†	 ddlm} d}t        D ]6  \  }}‰j                  |«      sŒ‰t        |«      d j                  |d«      } n |€9|j                  ‰dd «      }	‰j                  |	j                  d	«      xs d
d«      }|ŠnZ‰j                  ‰ j                  «      Š‰j                  d«      r.‰t        d«      d Šn‰j                  d«      r‰t        d«      d Š‰j                  dd«      Š‰j                  dd«      Š‰ j                  r‰j                  «       Šn‰ j                   r‰j                  d«      Š‰ j"                  dkD  r‰j%                  ‰ j"                  «      Š‰ j&                  r‰j)                  d«      s‰dz  Šˆ ˆfd„}
 |
«       }|st+        |‰ j,                  ‰ «      }|S # t        $ r}t        d«      |‚d}~ww xY w)ae  
        This method is the basic interface of a lexer. It is called by
        the `highlight()` function. It must process the text and return an
        iterable of ``(tokentype, value)`` pairs from `text`.

        Normally, you don't need to override this method. The default
        implementation processes the options recognized by all lexers
        (`stripnl`, `stripall` and so on), and then yields all tokens
        from `get_tokens_unprocessed()`, with the ``index`` dropped.

        If `unfiltered` is set to `True`, the filtering mechanism is
        bypassed even if filters are defined.
        r=   Úchardetr   )rQ   zkTo enable chardet encoding guessing, please install the chardet library from http://chardet.feedparser.org/NÚreplacei   r<   r   u   ï»¿z
ú
úc               3   óN   •K  — ‰j                  ‰«      D ]  \  } }}||f–— Œ y ­w©N)Úget_tokens_unprocessed)Ú_ÚtÚvrC   rO   s      €€r$   Ústreamerz"Lexer.get_tokens.<locals>.streamerù   s0   øè ø€ Ø×6Ñ6°tÓ<ò ‘��1�aØ˜�d“
ñùs   ƒ"%)rL   Ústrr<   r   Úpip._vendorrQ   ÚImportErrorÚ_encoding_mapÚ
startswithÚlenÚdecodeÚdetectrA   rR   r9   Ústripr8   r;   Ú
expandtabsr:   Úendswithr   r?   )rC   rO   Ú
unfilteredrX   rQ   ÚeÚdecodedÚbomr<   Úencr[   Ústreams   ``          r$   Ú
get_tokenszLexer.get_tokensÁ   så  ù€ ô ˜$¤Ô$Ø�}‰} Ò'Ü& tÓ,‘�‘aØ—‘ )Ò+ðTÝ3ð �Ü%2ò ‘M�C˜Ø—‘ sÕ+Ø"&¤s¨3£x y /×"8Ñ"8¸À9Ó"M˜Ùðð
 �?Ø!Ÿ.™.¨¨e¨t¨Ó5�CØ"Ÿk™k¨#¯'©'°*Ó*=Ò*HÀØ*3ó5�Gà‘à—{‘{ 4§=¡=Ó1�Ø—?‘? 8Ô,Ø¤ H£ Ð/‘Dà�‰˜xÔ(ØœC ›M˜NÐ+�ð �|‰|˜F DÓ)ˆØ�|‰|˜D $Ó'ˆØ�=Š=Ø—:‘:“<‰DØ�\Š\Ø—:‘:˜dÓ#ˆDØ�<‰<˜!ÒØ—?‘? 4§<¡<Ó0ˆDØ�=Š= §¡¨tÔ!4Ø�D‰LˆDõ	ñ “ˆÙÜ" 6¨4¯<©<¸Ó>ˆFØˆøôU #ò TÜ%ð 'Ló MàRSðTûðTús   ÁG2 Ç2	HÇ;HÈHc                 ó   — t         ‚)aS  
        This method should process the text and return an iterable of
        ``(index, tokentype, value)`` tuples where ``index`` is the starting
        position of the token within the input text.

        It must be overridden by subclasses. It is recommended to
        implement it as a generator to maximize effectiveness.
        )ÚNotImplementedError)rC   rO   s     r$   rW   zLexer.get_tokens_unprocessed  s
   € ô "Ð!r'   )F)r2   r3   r4   r5   r/   ÚaliasesÚ	filenamesÚalias_filenamesÚ	mimetypesÚpriorityÚurlrE   rJ   rB   r+   rm   rW   r"   r'   r$   r   r   1   sY   „ ñ1ðh €Dð €Gð
 €Ið €Oð €Ið €Hð €Cò%ò<Dò%òó">ó@	"r'   r   )Ú	metaclassc                   ó    — e Zd ZdZefd„Zd„ Zy)r   a   
    This lexer takes two lexer as arguments. A root lexer and
    a language lexer. First everything is scanned using the language
    lexer, afterwards all ``Other`` tokens are lexed using the root
    lexer.

    The lexers from the ``template`` lexer package use this base lexer.
    c                 ór   —  |di |¤Ž| _          |di |¤Ž| _        || _        t        j                  | fi |¤Ž y ©Nr"   )Ú
root_lexerÚlanguage_lexerÚneedler   rE   )rC   Ú_root_lexerÚ_language_lexerÚ_needler@   s        r$   rE   zDelegatingLexer.__init__  s9   € Ù%Ñ0¨Ñ0ˆŒÙ-Ñ8°Ñ8ˆÔØˆŒÜ�‰�tÑ'˜wÓ'r'   c                 ól  — d}g }g }| j                   j                  |«      D ]N  \  }}}|| j                  u r&|r|j                  t	        |«      |f«       g }||z  }Œ;|j                  |||f«       ŒP |r|j                  t	        |«      |f«       t        || j                  j                  |«      «      S )NÚ )r{   rW   r|   rM   ra   Údo_insertionsrz   )rC   rO   ÚbufferedÚ
insertionsÚ
lng_bufferÚirY   rZ   s           r$   rW   z&DelegatingLexer.get_tokens_unprocessed  s¾   € ØˆØˆ
Øˆ
Ø×*Ñ*×AÑAÀ$ÓGò 	-‰GˆAˆq�!Ø�D—K‘KÑÙØ×%Ñ%¤s¨8£}°jÐ&AÔBØ!#�JØ˜A‘‘à×!Ñ! 1 a¨ )Õ,ð	-ñ Ø×Ñœs 8›}¨jÐ9Ô:Ü˜ZØ!Ÿ_™_×CÑCÀHÓMóOð 	Or'   N)r2   r3   r4   r5   r   rE   rW   r"   r'   r$   r   r     s   „ ñð >Có (óOr'   r   c                   ó   — e Zd ZdZy)r   zI
    Indicates that a state should include rules from another state.
    N©r2   r3   r4   r5   r"   r'   r$   r   r   4  s   „ ñð 	r'   r   c                   ó   — e Zd ZdZd„ Zy)Ú_inheritzC
    Indicates the a state should inherit from its superclass.
    c                  ó   — y)Nr   r"   rI   s    r$   rJ   z_inherit.__repr__?  s   € Ør'   N)r2   r3   r4   r5   rJ   r"   r'   r$   rŠ   rŠ   ;  s   „ ñór'   rŠ   c                   ó   — e Zd ZdZd„ Zd„ Zy)Úcombinedz:
    Indicates a state combined from multiple states.
    c                 ó.   — t         j                  | |«      S rV   )Útupler-   )ÚclsÚargss     r$   r-   zcombined.__new__J  s   € Ü�}‰}˜S $Ó'Ð'r'   c                  ó   — y rV   r"   )rC   r‘   s     r$   rE   zcombined.__init__M  s   € àr'   N)r2   r3   r4   r5   r-   rE   r"   r'   r$   r�   r�   E  s   „ ñò(ór'   r�   c                   ó:   — e Zd ZdZd„ Zd	d„Zd	d„Zd	d„Zd„ Zd„ Z	y)
Ú_PseudoMatchz:
    A pseudo match object constructed from a string.
    c                 ó    — || _         || _        y rV   )Ú_textÚ_start)rC   ÚstartrO   s      r$   rE   z_PseudoMatch.__init__W  s   € ØˆŒ
Øˆ�r'   Nc                 ó   — | j                   S rV   )r—   ©rC   Úargs     r$   r˜   z_PseudoMatch.start[  s   € Ø�{‰{Ðr'   c                 óF   — | j                   t        | j                  «      z   S rV   )r—   ra   r–   rš   s     r$   Úendz_PseudoMatch.end^  s   € Ø�{‰{œS §¡›_Ñ,Ð,r'   c                 ó4   — |rt        d«      ‚| j                  S )NzNo such group)Ú
IndexErrorr–   rš   s     r$   Úgroupz_PseudoMatch.groupa  s   € ÙÜ˜_Ó-Ð-Ø�z‰zÐr'   c                 ó   — | j                   fS rV   )r–   rI   s    r$   Úgroupsz_PseudoMatch.groupsf  s   € Ø—
‘
ˆ}Ðr'   c                 ó   — i S rV   r"   rI   s    r$   Ú	groupdictz_PseudoMatch.groupdicti  s   € Øˆ	r'   rV   )
r2   r3   r4   r5   rE   r˜   r�   r    r¢   r¤   r"   r'   r$   r”   r”   R  s%   „ ñòóó-óò
ór'   r”   c                  ó   ‡ — dˆ fd„	}|S )zL
    Callback that yields multiple actions for each group in the match.
    c           
   3   ó¶  •K  — t        ‰«      D ]®  \  }}|€Œ	t        |«      t        u r1|j                  |dz   «      }|sŒ1|j	                  |dz   «      ||f–— ŒK|j                  |dz   «      }|€Œb|r|j	                  |dz   «      |_         || t        |j	                  |dz   «      |«      |«      D ]	  }|sŒ|–— Œ Œ° |r|j                  «       |_        y y ­w)Né   )Ú	enumerater,   r
   r    r˜   Úposr”   r�   )ÚlexerÚmatchÚctxr†   ÚactionÚdataÚitemr‘   s          €r$   Úcallbackzbygroups.<locals>.callbackq  sß   øè ø€ Ü" 4›ò 	'‰IˆAˆvØˆ~ØÜ�f“¤Ñ+Ø—{‘{ 1 q¡5Ó)�ÚØŸ+™+ a¨!¡eÓ,¨f°dÐ:Ó:à—{‘{ 1 q¡5Ó)�ØÑ#ÙØ"'§+¡+¨a°!©eÓ"4˜œÙ & uÜ'3°E·K±KÀÀAÁÓ4FÈÓ'MÈsó!Tò '˜âØ"&›Jñ'ð	'ñ  Ø—i‘i“kˆC�Gð ùs   ƒ<CÁ 0CÁ1ACÂ8!CrV   r"   )r‘   r°   s   ` r$   r   r   m  s   ø€ õ"ð& €Or'   c                   ó   — e Zd ZdZy)Ú_ThiszX
    Special singleton used for indicating the caller class.
    Used by ``using``.
    Nrˆ   r"   r'   r$   r²   r²   ‡  s   „ òr'   r²   c                 ó²   ‡ ‡‡— i Šd‰v r4‰j                  d«      }t        |t        t        f«      r|‰d<   nd|f‰d<   ‰ t        u r	dˆˆfd„	}|S dˆ ˆˆfd„	}|S )aÂ  
    Callback that processes the match with a different lexer.

    The keyword arguments are forwarded to the lexer, except `state` which
    is handled separately.

    `state` specifies the state that the new lexer will start in, and can
    be an enumerable such as ('root', 'inline', 'string') or a simple
    string which is assumed to be on top of the root state.

    Note: For that to work, `_other` must not be an `ExtendedRegexLexer`.
    ÚstateÚstackÚrootc              3   ó*  •K  — ‰	r.‰	j                  | j                  «        | j                  di ‰	¤Ž}n| }|j                  «       } |j                  |j                  «       fi ‰¤ŽD ]  \  }}}||z   ||f–— Œ |r|j                  «       |_        y y ­wry   )Úupdater@   rH   r˜   rW   r    r�   r©   )
rª   r«   r¬   ÚlxÚsr†   rY   rZ   Ú	gt_kwargsÚkwargss
           €€r$   r°   zusing.<locals>.callback¦  s‘   øè ø€ ñ à—‘˜eŸm™mÔ,Ø$�U—_‘_Ñ. vÑ.‘à�Ø—‘“ˆAØ4˜2×4Ñ4°U·[±[³]ÑPÀiÑPò "‘��1�aØ˜!‘e˜Q �kÓ!ð"áØŸ)™)›+�•ð ùs   ƒBBc              3   ó  •K  — ‰
j                  | j                  «        ‰di ‰
¤Ž}|j                  «       } |j                  |j	                  «       fi ‰	¤ŽD ]  \  }}}||z   ||f–— Œ |r|j                  «       |_        y y ­wry   )r¸   r@   r˜   rW   r    r�   r©   )rª   r«   r¬   r¹   rº   r†   rY   rZ   Ú_otherr»   r¼   s           €€€r$   r°   zusing.<locals>.callbackµ  s�   øè ø€ à�M‰M˜%Ÿ-™-Ô(ÙÑ!˜&Ñ!ˆBà—‘“ˆAØ4˜2×4Ñ4°U·[±[³]ÑPÀiÑPò "‘��1�aØ˜!‘e˜Q �kÓ!ð"áØŸ)™)›+�•ð ùs   ƒBBrV   )ÚpoprL   Úlistr�   r   )r¾   r¼   rº   r°   r»   s   ``  @r$   r   r   �  se   ú€ ð €IØ�&ÑØ�J‰J�wÓˆÜ�aœ$¤˜Ô'Ø!"ˆI�gÒà"(¨! ˆI�gÑà”�~ö	&ð2 €O÷		&ð €Or'   c                   ó   — e Zd ZdZd„ Zy)r   zÑ
    Indicates a state or state action (e.g. #pop) to apply.
    For example default('#pop') is equivalent to ('', Token, '#pop')
    Note that state tuples may be used as well.

    .. versionadded:: 2.0
    c                 ó   — || _         y rV   )r´   )rC   r´   s     r$   rE   zdefault.__init__Ê  s	   € Øˆ�
r'   N)r2   r3   r4   r5   rE   r"   r'   r$   r   r   Â  s   „ ñór'   r   c                   ó   — e Zd ZdZdd„Zd„ Zy)r   z•
    Indicates a list of literal words that is transformed into an optimized
    regex that matches any of the words.

    .. versionadded:: 2.0
    c                 ó.   — || _         || _        || _        y rV   )r   ÚprefixÚsuffix)rC   r   rÅ   rÆ   s       r$   rE   zwords.__init__Õ  s   € ØˆŒ
ØˆŒØˆ�r'   c                 óZ   — t        | j                  | j                  | j                  ¬«      S )N©rÅ   rÆ   )r   r   rÅ   rÆ   rI   s    r$   rA   z	words.getÚ  s   € Ü˜Ÿ™¨D¯K©KÀÇÁÔLÐLr'   N)r�   r�   )r2   r3   r4   r5   rE   rA   r"   r'   r$   r   r   Î  s   „ ñóó
Mr'   r   c                   ó<   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd
d„Zd„ Z	d	„ Z
y)ÚRegexLexerMetazw
    Metaclass for RegexLexer, creates the self._tokens attribute from
    self.tokens on the first instantiation.
    c                 ó‚   — t        |t        «      r|j                  «       }t        j                  ||«      j
                  S )zBPreprocess the regular expression component of a token definition.)rL   r   rA   ÚreÚcompiler«   )r�   ÚregexÚrflagsr´   s       r$   Ú_process_regexzRegexLexerMeta._process_regexä  s.   € ä�eœVÔ$Ø—I‘I“KˆEÜ�z‰z˜% Ó(×.Ñ.Ð.r'   c                 óR   — t        |«      t        u st        |«      s
J d|›�«       ‚|S )z5Preprocess the token component of a token definition.z0token type must be simple type or callable, not )r,   r
   Úcallable)r�   Útokens     r$   Ú_process_tokenzRegexLexerMeta._process_tokenê  s.   € ä�E‹{œjÑ(¬H°U¬Oñ 	LÙDIÐKó	LÐ;àˆr'   c                 óä  — t        |t        «      r5|dk(  ry||v r|fS |dk(  r|S |dd dk(  rt        |dd «       S J d|z  «       ‚t        |t        «      rfd| j                  z  }| xj                  d	z  c_        g }|D ]3  }||k7  s
J d
|z  «       ‚|j                  | j                  |||«      «       Œ5 |||<   |fS t        |t        «      r|D ]  }||v rŒ|dv rŒJ d|z   «       ‚ |S J d|z  «       ‚)z=Preprocess the state transition action of a token definition.ú#popéÿÿÿÿú#pushNé   z#pop:zunknown new state %rz_tmp_%dr§   zcircular state ref %r)rÖ   rØ   zunknown new state zunknown new state def %r)rL   r\   Úintr�   Ú_tmpnameÚextendÚ_process_stater�   )r�   Ú	new_stateÚunprocessedÚ	processedÚ	tmp_stateÚitokensÚistates          r$   Ú_process_new_statez!RegexLexerMeta._process_new_stateð  sK  € ä�i¤Ô%à˜FÒ"ØØ˜kÑ)Ø!�|Ð#Ø˜gÒ%Ø Ð Ø˜2˜A� 'Ò)Ü˜I a b˜MÓ*Ð*Ð*à@Ð4°yÑ@Ó@�uÜ˜	¤8Ô,à! C§L¡LÑ0ˆIØ�LŠL˜AÑ�LØˆGØ#ò F�Ø Ò*ÐLÐ,CÀfÑ,LÓLÐ*Ø—‘˜s×1Ñ1°+Ø2;¸Vó Eõ FðFð $+ˆI�iÑ Ø�<ÐÜ˜	¤5Ô)à#ò 2�Ø +Ò-ØÐ"3Ò3ð2à(¨6Ñ1ó2ð 4ð2ð Ðà@Ð4°yÑ@Ó@�5r'   c                 ó€  — t        |«      t        u s
J d|z  «       ‚|d   dk7  s
J d|z  «       ‚||v r||   S g x}||<   | j                  }||   D �]?  }t        |t        «      r;||k7  s
J d|z  «       ‚|j                  | j                  ||t        |«      «      «       ŒOt        |t        «      rŒ`t        |t        «      rO| j                  |j                  ||«      }|j                  t        j                  d«      j                  d|f«       Œ¿t        |«      t        u s
J d|z  «       ‚	 | j!                  |d   ||«      }| j'                  |d   «      }
t)        |«      dk(  rd}n| j                  |d   ||«      }|j                  ||
|f«       �ŒB |S # t"        $ r }	t%        d	|d   ›d
|›d| ›d|	›�«      |	‚d}	~	ww xY w)z%Preprocess a single state definition.zwrong state name %rr   ú#zinvalid state name %rzcircular state reference %rr�   Nzwrong rule def %rzuncompilable regex z
 in state z of z: r§   é   )r,   r\   ÚflagsrL   r   rÜ   rÝ   rŠ   r   rä   r´   rM   rÌ   rÍ   r«   r�   rÐ   Ú	ExceptionÚ
ValueErrorrÔ   ra   )r�   rß   rà   r´   ÚtokensrÏ   ÚtdefrÞ   ÚrexÚerrrÓ   s              r$   rÝ   zRegexLexerMeta._process_state  sè  € ä�E‹{œcÑ!Ð@Ð#8¸5Ñ#@Ó@Ð!Ø�Q‰x˜3ŠÐ?Ð 7¸%Ñ ?Ó?ˆØ�IÑØ˜UÑ#Ð#Ø$&Ð&ˆ�˜5Ñ!Ø—‘ˆØ Ñ&ó !	3ˆDÜ˜$¤Ô(à˜u’}ÐKÐ&CÀeÑ&KÓK�}Ø—‘˜c×0Ñ0°¸iÜ14°T³ó<ô =àÜ˜$¤Ô)ð Ü˜$¤Ô(Ø×2Ñ2°4·:±:¸{ÈIÓV�	Ø—‘œrŸz™z¨"›~×3Ñ3°T¸9ÐEÔFØä˜“:¤Ñ&ÐBÐ(;¸dÑ(BÓBÐ&ðFØ×(Ñ(¨¨a©°&¸%Ó@�ð
 ×&Ñ& t¨A¡wÓ/ˆEä�4‹y˜AŠ~Ø ‘	à×2Ñ2°4¸±7Ø3>À	óK�	ð �M‰M˜3  yÐ1Ö2ðC!	3ðD ˆøô ò FÝ Ø"& q£'ª5²#±sð"<ó =ØBEðFûðFús   Ä*FÆ	F=ÆF8Æ8F=Nc                 ó”   — i x}| j                   |<   |xs | j                  |   }t        |«      D ]  }| j                  |||«       Œ |S )z-Preprocess a dictionary of token definitions.)Ú_all_tokensrë   rÀ   rÝ   )r�   r/   Ú	tokendefsrà   r´   s        r$   Úprocess_tokendefzRegexLexerMeta.process_tokendef?  sS   € à,.Ð.ˆ	�C—O‘O DÑ)ØÒ1 §¡¨DÑ!1ˆ	Ü˜)“_ò 	<ˆEØ×Ñ˜y¨)°UÕ;ð	<àÐr'   c                 ó²  — i }i }| j                   D ]¥  }|j                  j                  di «      }|j                  «       D ]t  \  }}|j                  |«      }|€!|||<   	 |j	                  t
        «      }|||<   Œ:|j                  |d«      }|€ŒO||||dz    	 |j	                  t
        «      }	||	z   ||<   Œv Œ§ |S # t        $ r Y Œ†w xY w# t        $ r Y Œ•w xY w)a  
        Merge tokens from superclasses in MRO order, returning a single tokendef
        dictionary.

        Any state that is not defined by a subclass will be inherited
        automatically.  States that *are* defined by subclasses will, by
        default, override that state in the superclass.  If a subclass wishes to
        inherit definitions from a superclass, it can use the special value
        "inherit", which will cause the superclass' state definition to be
        included at that point in the state.
        rë   Nr§   )Ú__mro__Ú__dict__rA   ÚitemsÚindexr   rê   r¿   )
r�   rë   ÚinheritableÚcÚtoksr´   rö   ÚcuritemsÚinherit_ndxÚnew_inh_ndxs
             r$   Úget_tokendefszRegexLexerMeta.get_tokendefsG  s  € ð ˆØˆØ—‘ò 	CˆAØ—:‘:—>‘> (¨BÓ/ˆDà $§
¡
£ò C‘��uØ!Ÿ:™: eÓ,�ØÐ#ð
 %*�F˜5‘Mð!Ø&+§k¡k´'Ó&:˜ð *5�K Ñ&Øà)Ÿo™o¨e°TÓ:�ØÐ&Øð 7<�˜ [°¡]Ð3ðCð #(§+¡+¬gÓ"6�Kð *5°{Ñ)B�K Ò&ñ9Cð	CðB ˆøô) &ò !Ù ð!ûô "ò Ùðús$   ÁB;ÂC
Â;	CÃCÃ
	CÃCc                 óè   — d| j                   vrLi | _        d| _        t        | d«      r| j                  rn%| j                  d| j                  «       «      | _        t        j                  | g|¢­i |¤ŽS )z:Instantiate cls after preprocessing its token definitions.Ú_tokensr   Útoken_variantsr�   )
rõ   rð   rÛ   Úhasattrr  rò   rþ   r   r,   Ú__call__)r�   r‘   Úkwdss      r$   r  zRegexLexerMeta.__call__x  sh   € à˜CŸL™LÑ(Ø ˆCŒOØˆCŒLÜ�sÐ,Ô-°#×2DÒ2Dàà!×2Ñ2°2°s×7HÑ7HÓ7JÓK�”ä�}‰}˜SÐ0 4Ò0¨4Ñ0Ð0r'   rV   )r2   r3   r4   r5   rÐ   rÔ   rä   rÝ   rò   rþ   r  r"   r'   r$   rÊ   rÊ   Þ  s.   „ ñò
/òò!AòF*óXò/ób1r'   rÊ   c                   ó4   — e Zd ZdZej
                  Zi Zdd„Zy)r   z±
    Base for simple stateful regular expression-based lexers.
    Simplifies the lexing process so that you need only
    provide a list of states and regular expressions.
    c              #   ó:  K  — d}| j                   }t        |«      }||d      }	 |D �]&  \  }}}	 |||«      }
|
sŒ|�8t        |«      t        u r|||
j	                  «       f–— n || |
«      E d{  –—†  |
j                  «       }|	�Çt        |	t        «      rX|	D ]R  }|dk(  r t        |«      dkD  sŒ|j                  «        Œ(|dk(  r|j                  |d   «       ŒB|j                  |«       ŒT nWt        |	t        «      r#t        |	«      t        |«      k\  r|dd…= n*||	d…= n$|	dk(  r|j                  |d   «       n
J d|	z  «       ‚||d      } n7 	 ||   dk(  rd	g}|d	   }|t        df–— |dz  }�ŒP|t        ||   f–— |dz  }�Œd7 �Œ# t        $ r Y yw xY w­w)
z~
        Split ``text`` into (tokentype, text) pairs.

        ``stack`` is the initial stack (default: ``['root']``)
        r   r×   r§   NrÖ   rØ   úwrong state def: %rrS   r¶   )r   rÀ   r,   r
   r    r�   rL   r�   ra   r¿   rM   rÚ   Úabsr	   r   rŸ   )rC   rO   rµ   r©   rñ   Ú
statestackÚstatetokensÚrexmatchr­   rÞ   Úmr´   s               r$   rW   z!RegexLexer.get_tokens_unprocessed©  sÚ  è ø€ ð ˆØ—L‘Lˆ	Ü˜%“[ˆ
Ø 
¨2¡Ñ/ˆØØ/:ó 0Ñ+�˜& )Ù˜T 3Ó'�ÚØÐ)Ü ›<¬:Ñ5Ø"% v¨q¯w©w«yÐ"8Ó8á'-¨d°A£×6Ð6ØŸ%™%›'�CØ Ð,ä% i´Ô7Ø)2ò = Ø#(¨F¢?Ü'*¨:£¸Ó':Ø(2¯©Õ(8Ø%*¨gÒ%5Ø$.×$5Ñ$5°jÀ±nÕ$Eà$.×$5Ñ$5°eÕ$<ñ=ô (¨	´3Ô7ô  # 9›~´°Z³Ò@Ø$.¨q©r¡Nà$.¨y©zÑ$:Ø&¨'Ò1Ø&×-Ñ-¨j¸©nÕ=àKÐ*?À)Ñ*KÓK 5Ø&/°
¸2±Ñ&?˜ÙðC0ðJØ˜C‘y DÒ(à&, X˜
Ø&/°Ñ&7˜Ø!¤:¨tÐ3Ò3Ø˜q™˜Ù Øœu d¨3¡iÐ/Ò/Ø˜1‘H�Cñ_ ð 7úôP "ò ÙðüsM   ‚8F»5FÁ0F	Á1>FÂ0B!FÅ F Å2FÅ4F ÆFÆ	FÆFÆFÆFN©)r¶   )	r2   r3   r4   r5   rÌ   Ú	MULTILINErè   rë   rW   r"   r'   r$   r   r   †  s   „ ñð �L‰L€Eð0 €Fô;r'   r   c                   ó   — e Zd ZdZdd„Zd„ Zy)r   z9
    A helper object that holds lexer position data.
    Nc                 ó`   — || _         || _        |xs t        |«      | _        |xs dg| _        y )Nr¶   )rO   r©   ra   r�   rµ   )rC   rO   r©   rµ   r�   s        r$   rE   zLexerContext.__init__ì  s.   € ØˆŒ	ØˆŒØÒ#œ#˜d›)ˆŒØÒ&˜v˜hˆ�
r'   c                 óV   — d| j                   ›d| j                  ›d| j                  ›d�S )NzLexerContext(z, ú))rO   r©   rµ   rI   s    r$   rJ   zLexerContext.__repr__ò  s   � à�I‹I�t—x“x §£ð-ð 	-r'   ©NN)r2   r3   r4   r5   rE   rJ   r"   r'   r$   r   r   ç  s   „ ñó'ó-r'   r   c                   ó   — e Zd ZdZdd„Zy)r   zE
    A RegexLexer that uses a context object to store its state.
    Nc              #   ó–  K  — | j                   }|st        |d«      }|d   }n |}||j                  d      }|j                  }	 |D �]Î  \  }}} |||j                  |j
                  «      }	|	sŒ)|�lt        |«      t        u r5|j                  ||	j                  «       f–— |	j                  «       |_        n& || |	|«      E d{  –—†  |s||j                  d      }|��5t        |t        «      rŠ|D ]„  }
|
dk(  r4t        |j                  «      dkD  sŒ!|j                  j                  «        Œ<|
dk(  r)|j                  j                  |j                  d   «       Œj|j                  j                  |
«       Œ† n‰t        |t        «      rAt        |«      t        |j                  «      k\  r|j                  dd…= nH|j                  |d…= n8|dk(  r)|j                  j                  |j                  d   «       n
J d|z  «       ‚||j                  d      } nž 	 |j                  |j
                  k\  ry||j                     d	k(  r9dg|_        |d   }|j                  t         d	f–— |xj                  dz  c_        �Œ;|j                  t"        ||j                     f–— |xj                  dz  c_        �Œs7 �Œó# t$        $ r Y yw xY w­w)
z
        Split ``text`` into (tokentype, text) pairs.
        If ``context`` is given, use this lexer context instead.
        r   r¶   r×   r§   NrÖ   rØ   r  rS   )r   r   rµ   rO   r©   r�   r,   r
   r    rL   r�   ra   r¿   rM   rÚ   r  r   r   rŸ   )rC   rO   Úcontextrñ   r¬   r
  r  r­   rÞ   r  r´   s              r$   rW   z)ExtendedRegexLexer.get_tokens_unprocessedü  su  è ø€ ð
 —L‘Lˆ	ÙÜ˜t QÓ'ˆCØ# FÑ+‰KàˆCØ# C§I¡I¨b¡MÑ2ˆKØ—8‘8ˆDØØ/:ó 2Ñ+�˜& )Ù˜T 3§7¡7¨C¯G©GÓ4�ÚØÐ)Ü ›<¬:Ñ5Ø"%§'¡'¨6°1·7±7³9Ð"<Ò<Ø&'§e¡e£g˜C�Gá'-¨d°A°sÓ';×;Ð;Ù#,à.7¸¿	¹	À"¹Ñ.F à Ñ,ä% i´Ô7Ø)2ò < Ø#(¨F¢?Ü'*¨3¯9©9£~¸Ó'9Ø(+¯	©	¯©­Ø%*¨gÒ%5Ø$'§I¡I×$4Ñ$4°S·Y±Y¸r±]Õ$Cà$'§I¡I×$4Ñ$4°UÕ$;ñ<ô (¨	´3Ô7ä" 9›~´°S·Y±Y³Ò?Ø$'§I¡I¨a©b¡Mà$'§I¡I¨i©jÑ$9Ø&¨'Ò1ØŸI™I×,Ñ,¨S¯Y©Y°r©]Õ;àKÐ*?À)Ñ*KÓK 5Ø&/°·	±	¸"±Ñ&>˜ÙðG2ðJØ—w‘w #§'¡'Ò)ØØ˜CŸG™G‘}¨Ò,à%+ H˜œ	Ø&/°Ñ&7˜Ø!Ÿg™g¤t¨TÐ1Ò1ØŸš 1™�Ù ØŸ'™'¤5¨$¨s¯w©w©-Ð7Ò7Ø—G’G˜q‘L•Gñc ð <úôR "ò Ùðüs^   ‚A,K	Á/AK	ÃJ7ÃAK	ÄDK	ÈJ: È2K	È3A	J: É<K	É>7J: Ê5K	Ê:	KËK	ËKËK	r  )r2   r3   r4   r5   rW   r"   r'   r$   r   r   ÷  s   „ ñô@r'   r   c              #   ó   K  — t        | «      } 	 t        | «      \  }}d}d}|D ]°  \  }}}|€|}d}	|rx|t        |«      z   |k\  rg||	||z
   }
|
r|||
f–— |t        |
«      z  }|D ]  \  }}}|||f–— |t        |«      z  }Œ ||z
  }		 t        | «      \  }}|r|t        |«      z   |k\  rŒg|	t        |«      k  sŒ–||||	d f–— |t        |«      |	z
  z  }Œ² |r9|xs d}|D ]  \  }}}|||f–— |t        |«      z  }Œ 	 t        | «      \  }}|rŒ8yy# t        $ r |E d{  –—†7   Y yw xY w# t        $ r d}Y Œ�w xY w# t        $ r d}Y yw xY w­w)ag  
    Helper for lexers which must combine the results of several
    sublexers.

    ``insertions`` is a list of ``(index, itokens)`` pairs.
    Each ``itokens`` iterable should be inserted at position
    ``index`` into the token stream given by the ``tokens``
    argument.

    The result is a combined token stream.

    TODO: clean up the code here.
    NTr   F)ÚiterÚnextÚStopIterationra   )r„   rë   r÷   râ   ÚrealposÚinsleftr†   rY   rZ   ÚoldiÚtmpvalÚit_indexÚit_tokenÚit_valueÚps                  r$   r‚   r‚   ?  sÎ  è ø€ ô �jÓ!€JðÜ˜jÓ)‰ˆˆwð €GØ€Gð ò %‰ˆˆ1ˆaàˆ?ØˆGØˆÙ˜!œc !›f™*¨Ò-Ø�t˜E A™IÐ&ˆFÙØ˜q &Ð(Ò(Øœ3˜v›;Ñ&�Ø07ò )Ñ,�˜( HØ˜x¨Ð1Ò1Øœ3˜x›=Ñ(‘ð)ð ˜1‘9ˆDðÜ!% jÓ!1‘��wñ ˜!œc !›f™*¨Ó-ð ”#�a“&‹=Ø˜1˜a  ˜hÐ&Ò&Ø”s˜1“v ‘}Ñ$‰Gð+%ñ0 à’,˜QˆØò 	‰GˆAˆq�!Ø˜1˜a�-ÒØ”s˜1“vÑ‰Gð	ð	Ü! *Ó-‰NˆE�7ô øôE ò à×ÑÙðûô4 !ò Ø�Ùðûô  ò 	ØˆGÙð	üs�   ‚E�D �A*EÂD,ÂEÂ*EÂ9AEÃ?D= ÄEÄEÄD)Ä D#Ä!D)Ä&EÄ(D)Ä)EÄ,D:Ä7EÄ9D:Ä:EÄ=EÅEÅ
EÅEc                   ó   — e Zd ZdZd„ Zy)ÚProfilingRegexLexerMetaz>Metaclass for ProfilingRegexLexer, collects regex timing info.c                 óè   ‡ ‡‡‡— t        |t        «      r-t        |j                  |j                  |j                  ¬«      Šn|Št        j                  ‰|«      Št        j                  fˆ ˆˆˆfd„	}|S )NrÈ   c                 óþ   •— ‰j                   d   j                  ‰
‰	fddg«      }t        j                  «       }‰j                  | ||«      }t        j                  «       }|dxx   dz  cc<   |dxx   ||z
  z  cc<   |S )Nr×   r   r!   r§   )Ú
_prof_dataÚ
setdefaultÚtimer«   )rO   r©   ÚendposÚinfoÚt0ÚresÚt1r�   Úcompiledrí   r´   s          €€€€r$   Ú
match_funcz:ProfilingRegexLexerMeta._process_regex.<locals>.match_funcŠ  sr   ø€ Ø—>‘> "Ñ%×0Ñ0°%¸°ÀÀ3¸xÓHˆDÜ—‘“ˆBØ—.‘.  s¨FÓ3ˆCÜ—‘“ˆBØ�‹G�q‰L‹GØ�‹G�r˜B‘wÑ‹GØˆJr'   )	rL   r   r   rÅ   rÆ   rÌ   rÍ   ÚsysÚmaxsize)r�   rÎ   rÏ   r´   r0  r/  rí   s   `  ` @@r$   rÐ   z&ProfilingRegexLexerMeta._process_regex‚  sZ   û€ Ü�eœUÔ#Ü˜EŸK™K°·±Ø#(§<¡<ô1‰Cð ˆCÜ—:‘:˜c 6Ó*ˆä),¯©÷ 	ð 	ð Ðr'   N)r2   r3   r4   r5   rÐ   r"   r'   r$   r$  r$    s
   „ ÙHór'   r$  c                   ó    — e Zd ZdZg ZdZdd„Zy)ÚProfilingRegexLexerzFDrop-in replacement for RegexLexer that does profiling of its regexes.é   c              #   óJ  ‡ K  — ‰ j                   j                  j                  i «       t        j	                  ‰ ||«      E d {  –—†  ‰ j                   j                  j                  «       }t        d„ |j                  «       D «       ˆ fd„d¬«      }t        d„ |D «       «      }t        «        t        d‰ j                   j                  t        |«      |fz  «       t        d«       t        dd	z  «       t        d
«       |D ]  }t        d|z  «       Œ t        d«       y 7 ŒÝ­w)Nc              3   ó¤   K  — | ]H  \  \  }}\  }}|t        |«      j                  d «      j                  dd«      dd |d|z  d|z  |z  f–— ŒJ y­w)zu'z\\ú\NéA   iè  )Úreprrd   rR   )Ú.0rº   ÚrÚnrY   s        r$   ú	<genexpr>z=ProfilingRegexLexer.get_tokens_unprocessed.<locals>.<genexpr>   sa   è ø€ ò @á+™F˜Q ¡F Q¨ð œ4 ›7Ÿ=™=¨Ó/×7Ñ7¸ÀÓEÀcÀrÐJØ˜4 !™8 T¨A¡X°¡\ô3ñ @ùs   ‚AAc                 ó"   •— | ‰j                      S rV   )Ú_prof_sort_index)r#   rC   s    €r$   r%   z<ProfilingRegexLexer.get_tokens_unprocessed.<locals>.<lambda>£  s   ø€  A d×&;Ñ&;Ñ$<€ r'   T)ÚkeyÚreversec              3   ó&   K  — | ]	  }|d    –— Œ y­w)é   Nr"   )r;  r#   s     r$   r>  z=ProfilingRegexLexer.get_tokens_unprocessed.<locals>.<genexpr>¥  s   è ø€ Ò+ ˜˜!�Ñ+ùs   ‚z2Profiling result for %s lexing %d chars in %.3f mszn==============================================================================================================z$%-20s %-64s ncalls  tottime  percall)r´   rÎ   zn--------------------------------------------------------------------------------------------------------------z%-20s %-65s %5d %8.4f %8.4f)rH   r'  rM   r   rW   r¿   Úsortedrö   ÚsumÚprintr2   ra   )rC   rO   rµ   Úrawdatar®   Ú	sum_totalr1   s   `      r$   rW   z*ProfilingRegexLexer.get_tokens_unprocessed›  sÿ   øè ø€ à�‰×!Ñ!×(Ñ(¨Ô,Ü×4Ñ4°T¸4ÀÓG×GÐGØ—.‘.×+Ñ+×/Ñ/Ó1ˆÜñ @à/6¯}©}«ô@ó =Ø"ô	$ˆô
 Ñ+ dÔ+Ó+ˆ	äŒÜÐBØ�~‰~×&Ñ&¬¨D«	°9Ð=ñ>ô 	?äˆiÔÜÐ4Ð7IÑIÔJÜˆiÔØò 	5ˆAÜÐ/°!Ñ3Õ4ð	5äˆiÕð# 	Hús   ƒA D#ÁD!ÁCD#Nr  )r2   r3   r4   r5   r'  r@  rW   r"   r'   r$   r4  r4  •  s   „ ÙPà€JØÐôr'   r4  )6r5   rÌ   r1  r)  Úpip._vendor.pygments.filterr   r   Úpip._vendor.pygments.filtersr   Úpip._vendor.pygments.tokenr   r   r   r	   r
   Úpip._vendor.pygments.utilr   r   r   r   r   r   Úpip._vendor.pygments.regexoptr   Ú__all__rÍ   r   r_   ÚstaticmethodÚ_default_analyser,   r)   r   r   r\   r   rŠ   r   r�   r�   r”   r   r²   r   r   r   r   rÊ   r   r   r   r‚   r$  r4  r"   r'   r$   ú<module>rR     sJ  ðñó 
Û 
Û ç =Ý ;ß QÕ Q÷*÷ *å 3ò*€ð ˆ"�*‰*�WÓ
€ò,€ñ  ¡Ó.Ð ô	1�ô 	1ôY"�iõ Y"ôxO�eô OôN	ˆcô 	÷ñ ñ ‹*€ô
ˆuô 
÷ñ ò6÷4ñ ñ ƒw€ò/÷d	ñ 	ôMˆFô Mô e1�Yô e1ôP^� .õ ^÷B-ñ -ô E˜ô EòP=ô@˜nô ô,˜*Ð0Gö r'   