Ë
    æØjjR‰  ã                   ó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-present 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    úP/opt/eval-harness/bench_task/venv/lib/python3.12/site-packages/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                   ó`   — 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„ Zd„ Zd„ Zdd	„Zd
„ Zy)r   a"  
    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 two additional attributes:

    .. autoattribute:: url
       :no-value:
    .. autoattribute:: version_added
       :no-value:

    Lexers included in Pygments may have additional attributes:

    .. autoattribute:: _example
       :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                  › d�S )Nz<pygments.lexers.z with ú>)r@   Ú	__class__r2   ©rC   s    r$   Ú__repr__zLexer.__repr__¯   sI   € Ø�<Š<Ø& t§~¡~×'>Ñ'>Ð&?¸vÀdÇlÁlÐEUÐUVÐWÐWà& t§~¡~×'>Ñ'>Ð&?¸qÐAÐAr'   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}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  }|S # t
        $ r}t        d«      |‚d}~ww xY w)zVApply preprocessing such as decoding the input, removing BOM and normalizing newlines.r=   Úchardetr   NzkTo enable chardet encoding guessing, please install the chardet library from http://chardet.feedparser.org/Úreplacei   r<   r   u   ï»¿z
ú
ú)rL   Ústrr<   r   rQ   ÚImportErrorÚ_encoding_mapÚ
startswithÚlenÚdecodeÚdetectrA   rR   r9   Ústripr8   r;   Ú
expandtabsr:   Úendswith)	rC   rO   Ú_rQ   ÚeÚdecodedÚbomr<   Úencs	            r$   Ú_preprocess_lexer_inputzLexer._preprocess_lexer_inputÎ   sÁ  € ô ˜$¤Ô$Ø�}‰} Ò'Ü& tÓ,‘�‘aØ—‘ )Ò+ðTÛ"ð �Ü%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àˆøôI #ò TÜ%ð 'Ló MàRSðTûðTús   ¿G Ç	G"ÇGÇG"c                 óx   ‡ ‡— ‰ j                  ‰«      Šˆ ˆfd„} |«       }|st        |‰ j                  ‰ «      }|S )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.
        c               3   óN   •K  — ‰j                  ‰«      D ]  \  } }}||f–— Œ y ­w©N)Úget_tokens_unprocessed)r_   ÚtÚvrC   rO   s      €€r$   Ústreamerz"Lexer.get_tokens.<locals>.streamer  s0   øè ø€ Ø×6Ñ6°tÓ<ò ‘��1�aØ˜�d“
ñùs   ƒ"%)rd   r   r?   )rC   rO   Ú
unfilteredrk   Ústreams   ``   r$   Ú
get_tokenszLexer.get_tokensý   s=   ù€ ð ×+Ñ+¨DÓ1ˆõ	ñ “ˆÙÜ" 6¨4¯<©<¸Ó>ˆFØˆr'   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$   rh   zLexer.get_tokens_unprocessed  s
   € ô "Ð!r'   )F)r2   r3   r4   r5   r/   ÚaliasesÚ	filenamesÚalias_filenamesÚ	mimetypesÚpriorityÚurlÚversion_addedÚ_examplerE   rJ   rB   r+   rd   rn   rh   r"   r'   r$   r   r   1   sl   „ ñ8ðv €Dð €Gð
 €Ið €Oð €Ið €Hð €Cð €Mð €Hò%ò<Bò%òò"-ó^ó0	"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~   rh   r   rM   rY   Údo_insertionsr}   )rC   rO   ÚbufferedÚ
insertionsÚ
lng_bufferÚiri   rj   s           r$   rh   z&DelegatingLexer.get_tokens_unprocessed1  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   rh   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   H  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  s   € Ør'   N)r2   r3   r4   r5   rJ   r"   r'   r$   r�   r�   O  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 rg   )Útupler-   )ÚclsÚargss     r$   r-   zcombined.__new__^  s   € Ü�}‰}˜S $Ó'Ð'r'   c                  ó   — y rg   r"   )rC   r”   s     r$   rE   zcombined.__init__a  s   € àr'   N)r2   r3   r4   r5   r-   rE   r"   r'   r$   r�   r�   Y  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 rg   )Ú_textÚ_start)rC   ÚstartrO   s      r$   rE   z_PseudoMatch.__init__k  s   € ØˆŒ
Øˆ�r'   Nc                 ó   — | j                   S rg   )rš   ©rC   Úargs     r$   r›   z_PseudoMatch.starto  s   € Ø�{‰{Ðr'   c                 óF   — | j                   t        | j                  «      z   S rg   )rš   rY   r™   r�   s     r$   Úendz_PseudoMatch.endr  s   € Ø�{‰{œS §¡›_Ñ,Ð,r'   c                 ó4   — |rt        d«      ‚| j                  S )NzNo such group)Ú
IndexErrorr™   r�   s     r$   Úgroupz_PseudoMatch.groupu  s   € ÙÜ˜_Ó-Ð-Ø�z‰zÐr'   c                 ó   — | j                   fS rg   )r™   rI   s    r$   Úgroupsz_PseudoMatch.groupsz  s   € Ø—
‘
ˆ}Ðr'   c                 ó   — i S rg   r"   rI   s    r$   Ú	groupdictz_PseudoMatch.groupdict}  s   € Øˆ	r'   rg   )
r2   r3   r4   r5   rE   r›   r    r£   r¥   r§   r"   r'   r$   r—   r—   f  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>.callback…  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rg   r"   )r”   r³   s   ` r$   r   r   �  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  — ‰
r9t        | j                  «      }|j                  ‰
«        | j                  di |¤Ž}n| }|j	                  «       } |j
                  |j                  «       fi ‰	¤ŽD ]  \  }}}||z   ||f–— Œ |r|j                  «       |_        y y ­wr|   )	Údictr@   ÚupdaterH   r›   rh   r£   r    r¬   )r­   r®   r¯   r1   ÚlxÚsr‰   ri   rj   Ú	gt_kwargsÚkwargss            €€r$   r³   zusing.<locals>.callbackº  s›   øè ø€ ñ ä˜Ÿ™Ó'�Ø—‘˜Ô Ø$�U—_‘_Ñ) qÑ)‘à�Ø—‘“ˆAØ4˜2×4Ñ4°U·[±[³]ÑPÀiÑPò "‘��1�aØ˜!‘e˜Q �kÓ!ð"áØŸ)™)›+�•ð ùs   ƒBBc              3   ó"  •K  — t        | j                  «      }|j                  ‰«        ‰	di |¤Ž}|j                  «       } |j                  |j                  «       fi ‰
¤ŽD ]  \  }}}||z   ||f–— Œ |r|j                  «       |_        y y ­wr|   )r»   r@   r¼   r›   rh   r£   r    r¬   )r­   r®   r¯   r1   r½   r¾   r‰   ri   rj   Ú_otherr¿   rÀ   s            €€€r$   r³   zusing.<locals>.callbackÊ  s‰   øè ø€ ä�U—]‘]Ó#ˆAØ�H‰H�VÔÙ‘˜!‘ˆBà—‘“ˆAØ4˜2×4Ñ4°U·[±[³]ÑPÀiÑPò "‘��1�aØ˜!‘e˜Q �kÓ!ð"áØŸ)™)›+�•ð ùs   ƒBBrg   )ÚpoprL   Úlistr’   r   )rÂ   rÀ   r¾   r³   r¿   s   ``  @r$   r   r   ¤  se   ú€ ð €IØ�&ÑØ�J‰J�wÓˆÜ�aœ$¤˜Ô'Ø!"ˆI�gÒà"(¨! ˆI�gÑà”�~ö	&ð6 €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 rg   )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 rg   )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   s2   € ä�E‹{œjÑ(¬H°U¬Oð 	IØ>¸u¸iÐHó	IÐ;àˆ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|›�«       ‚t        |t        «      rfd| j                  z  }| xj                  d	z  c_        g }|D ]3  }||k7  s
J d
|›�«       ‚|j                  | j                  |||«      «       Œ5 |||<   |fS t        |t        «      r|D ]  }||v rŒ|dv rŒJ d|z   «       ‚ |S J d|›�«       ‚)z=Preprocess the state transition action of a token definition.ú#popéÿÿÿÿú#pushNé   z#pop:zunknown new state z_tmp_%drª   zcircular state ref )rÚ   rÜ   zunknown new state def )rL   rU   Úintr�   Ú_tmpnameÚextendÚ_process_stater’   )r“   Ú	new_stateÚunprocessedÚ	processedÚ	tmp_stateÚitokensÚistates          r$   Ú_process_new_statez!RegexLexerMeta._process_new_state  sQ  € ä�i¤Ô%à˜FÒ"ØØ˜kÑ)Ø!�|Ð#Ø˜gÒ%Ø Ð Ø˜2˜A� 'Ò)Ü˜I a b˜MÓ*Ð*Ð*à@Ð 2°9°-Ð@Ó@�uÜ˜	¤8Ô,à! C§L¡LÑ0ˆIØ�LŠL˜AÑ�LØˆGØ#ò F�Ø Ò*ÐLÐ.AÀ&ÀÐ,LÓLÐ*Ø—‘˜s×1Ñ1°+Ø2;¸Vó Eõ FðFð $+ˆI�iÑ Ø�<ÐÜ˜	¤5Ô)à#ò 2�Ø +Ò-ØÐ"3Ò3ð2à(¨6Ñ1ó2ð 4ð2ð Ðà@Ð2°9°-Ð@Ó@�5r'   c                 ó~  — t        |t        «      s
J d|›�«       ‚|d   dk7  s
J d|›�«       ‚||v r||   S g x}||<   | j                  }||   D �]?  }t        |t        «      r;||k7  s
J d|›�«       ‚|j	                  | j                  ||t        |«      «      «       ŒOt        |t        «      rŒ`t        |t        «      rO| j                  |j                  ||«      }|j                  t        j                  d«      j                  d|f«       Œ¿t        |«      t        u s
J d|›�«       ‚	 | 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 r   ú#zinvalid state name zcircular state reference r„   Nzwrong rule def zuncompilable regex z
 in state z of z: rª   é   )rL   rU   Úflagsr   rà   rá   r�   r   rè   r·   rM   rÐ   rÑ   r®   r,   r’   rÔ   Ú	ExceptionÚ
ValueErrorrØ   rY   )r“   rã   rä   r·   ÚtokensrÓ   Útdefrâ   ÚrexÚerrr×   s              r$   rá   zRegexLexerMeta._process_state)  sü  € ä˜%¤Ô%ÐDÐ):¸5¸)Ð'DÓDÐ%Ø�Q‰x˜3ŠÐ?Ð"5°e°YÐ ?Ó?ˆØ�IÑØ˜UÑ#Ð#Ø$&Ð&ˆ�˜5Ñ!Ø—‘ˆØ Ñ&ó  	3ˆDÜ˜$¤Ô(à˜u’}ÐKÐ(AÀ%ÀÐ&KÓK�}Ø—‘˜c×0Ñ0°¸iÜ14°T³ó<ô =àÜ˜$¤Ô)ð Ü˜$¤Ô(Ø×2Ñ2°4·:±:¸{ÈIÓV�	Ø—‘œrŸz™z¨"›~×3Ñ3°T¸9ÐEÔFØä˜“:¤Ñ&ÐB¨/¸$¸Ð(BÓBÐ&ðrØ×(Ñ(¨¨a©°&¸%Ó@�ð ×&Ñ& t¨A¡wÓ/ˆEä�4‹y˜AŠ~Ø ‘	à×2Ñ2°4¸±7Ø3>À	óK�	ð �M‰M˜3  yÐ1Ö2ðA 	3ðB ˆøô ò rÜ Ð#6°t¸A±w°kÀÈEÈ9ÐTXÐY\ÐX_Ð_aÐbeÐafÐ!gÓhÐnqÐqûðrús   Ä)FÆ	F<ÆF7Æ7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_tokendefT  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_tokendefs\  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__�  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'   rg   )r2   r3   r4   r5   rÔ   rØ   rè   rá   rö   r  r  r"   r'   r$   rÎ   rÎ   ô  s.   „ ñò
/òò!AòF)óVò/ó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|	›�«       ‚||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: rS   r¹   )r  rÄ   r,   r
   r£   r    rL   r’   rY   rÃ   rM   rÞ   Úabsr	   r   r¢   )rC   rO   r¸   r¬   rõ   Ú
statestackÚstatetokensÚrexmatchr°   râ   Úmr·   s               r$   rh   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Ð,=¸i¸]Ð*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ï   rh   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¬   rY   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)   € Ø˜tŸy™y˜m¨2¨d¯h©h¨\¸¸D¿J¹J¸>ÈÐKÐKr'   ©NN)r2   r3   r4   r5   rE   rJ   r"   r'   r$   r   r   ü  s   „ ñó'óL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|›�«       ‚||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’   rY   rÃ   rM   rÞ   r  r   r   r¢   )rC   rO   Úcontextrõ   r¯   r  r  r°   râ   r  r·   s              r$   rh   z)ExtendedRegexLexer.get_tokens_unprocessed  sw  è ø€ ð
 —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Ð,=¸i¸]Ð*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   rh   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ÚStopIterationrY   )r‡   rï   rû   ræ   ÚrealposÚinsleftr‰   ri   rj   ÚoldiÚtmpvalÚit_indexÚit_tokenÚit_valueÚps                  r$   r…   r…   S  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·   r4  r3  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è  )Úreprr\   rR   )Ú.0r¾   ÚrÚnri   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 rg   )Ú_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$   rB  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   rh   rÃ   Úsortedrú   ÚsumÚprintr2   rY   )rC   rO   r¸   Úrawdatar±   Ú	sum_totalr1   s   `      r$   rh   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+  rD  rh   r"   r'   r$   r8  r8  ©  s   „ ÙPà€JØÐôr'   r8  )6r5   rÐ   r5  r-  Úpygments.filterr   r   Úpygments.filtersr   Úpygments.tokenr   r   r   r	   r
   Úpygments.utilr   r   r   r   r   r   Úpygments.regexoptr   Ú__all__rÑ   r   rW   ÚstaticmethodÚ_default_analyser,   r)   r   r   rU   r   r�   r   r’   r�   r—   r   rµ   r   r   r   r   rÎ   r   r   r   r…   r(  r8  r"   r'   r$   ú<module>rV     sL  ðñó 
Û 
Û ç 1Ý /ß EÕ E÷*÷ *å 'ò*€ð ˆ"�*‰*�WÓ
€ò,€ñ  ¡Ó.Ð ô	1�ô 	1ôm"�iõ m"ô`O�eô OôN	ˆcô 	÷ñ ñ ‹*€ô
ˆuô 
÷ñ ò6÷4ñ ñ ƒw€ò1÷h	ñ 	ôMˆFô Mô d1�Yô d1ôN^� .õ ^÷BLñ LôE˜ô EòP=ô@˜nô ô,˜*Ð0Gö r'   