
    q"h                     F   S r SSKrSSKrSSKrSSKJrJr  SSKJr  SSK	J
r
JrJrJrJr  SSKJrJrJrJrJrJr  SSKJr  / SQr\R2                  " S	5      r/ S
Qr\" S 5      r " S S\5      r " S S\S9r  " S S\ 5      r! " S S\"5      r# " S S5      r$\$" 5       r% " S S\&5      r' " S S5      r(S r) " S S5      r*\*" 5       r+S r, " S S 5      r- " S! S"\5      r. " S# S$\5      r/ " S% S&\ \/S9r0 " S' S(5      r1 " S) S*\05      r2S+ r3 " S, S-\/5      r4 " S. S/\0\4S9r5g)0z
pygments.lexer
~~~~~~~~~~~~~~

Base lexer classes.

:copyright: Copyright 2006-2025 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   ﻿zutf-8)s     zutf-32)s     zutf-32be)s   zutf-16)s   zutf-16bec                     g)N         )xs    L/var/www/html/env/lib/python3.13/site-packages/pip/_vendor/pygments/lexer.py<lambda>r$   "   s    #    c                       \ rS rSrSrS rSrg)	LexerMeta%   zv
This metaclass automagically converts ``analyse_text`` methods into
static methods which always return float values.
c                 \    SU;   a  [        US   5      US'   [        R                  XX#5      $ )Nanalyse_text)r   type__new__)mcsnamebasesds       r#   r,   LexerMeta.__new__+   s/    Q /.0A BAn||Cu00r%   r!   N)__name__
__module____qualname____firstlineno____doc__r,   __static_attributes__r!   r%   r#   r'   r'   %   s    
1r%   r'   c                   j    \ rS rSrSrSr/ r/ r/ r/ r	Sr
SrSrSrS rS rS rS rS	 rSS
 jrS rSrg)r   1   an  
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                 x   Xl         [        USS5      U l        [        USS5      U l        [        USS5      U l        [        USS5      U l        UR                  SS	5      U l        UR                  S
5      =(       d    U R                  U l        / U l	        [        USS5       H  nU R                  U5        M     g)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   r;   r<   r=   r   r>   getr?   rB   r   
add_filter)selfrC   filter_s      r#   __init__Lexer.__init__   s    & #GY=$Wj%@$Wj$?"7Iq9J8L1BT]]#GY;GOOG$ <r%   c                     U R                   (       a(  SU R                  R                   SU R                   < S3$ SU R                  R                   S3$ )Nz<pygments.lexers.z with >)rC   	__class__r2   rF   s    r#   __repr__Lexer.__repr__   sI    <<&t~~'>'>&?vdllEUUVWW&t~~'>'>&?qAAr%   c                 |    [        U[        5      (       d  [        U40 UD6nU R                  R	                  U5        g)z(
Add a new stream filter to this lexer.
N)
isinstancer   r   rB   append)rF   rG   rC   s      r#   rE   Lexer.add_filter   s2     '6**(<G<GG$r%   c                     g)aa  
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*   Lexer.analyse_text   s    r%   c                 &   [        U[        5      (       dz  U R                  S:X  a  [        U5      u  pOU R                  S:X  a   [	        S5      eUR                  U R                  5      nUR                  S5      (       a  U[        S5      S nO$UR                  S5      (       a  U[        S5      S nUR                  SS5      nUR                  S	S5      nU R                  (       a  UR                  5       nO"U R                  (       a  UR                  S5      nU R                   S
:  a  UR#                  U R                   5      nU R$                  (       a  UR'                  S5      (       d  US-  nU$ ! [         a  n[	        S5      UeSnAff = f)zVApply preprocessing such as decoding the input, removing BOM and normalizing newlines.r@   chardetzchardet is not vendored by pipzkTo enable chardet encoding guessing, please install the chardet library from http://chardet.feedparser.org/Nu   ﻿z

r   )rQ   strr?   r   ImportError_encoding_map
startswithlendecoderX   detectrD   replacer<   stripr;   r>   
expandtabsr=   endswith)rF   rU   _edecodedbomr?   encs           r#   _preprocess_lexer_inputLexer._preprocess_lexer_input   sU    $$$}}'&t,a)+T &&FGG$ {{4==1??8,,H/Dx((CMN+ ||FD)||D$'==::<D\\::d#D<<!??4<<0D==t!4!4DLDI # T% 'L MRSTTs   E5 5
F?FFc                    ^ ^ T R                  T5      mU U4S jnU" 5       nU(       d  [        UT R                  T 5      nU$ )a  
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   >#    TR                  T5       H  u  pnX4v   M     g 7fN)get_tokens_unprocessed)rf   tvrF   rU   s      r#   streamer"Lexer.get_tokens.<locals>.streamer  s&     66t<ad
 =s   "%)rk   r   rB   )rF   rU   
unfilteredrs   streams   ``   r#   
get_tokensLexer.get_tokens   s=     ++D1	 "64<<>Fr%   c                     [         e)a#  
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)rF   rU   s     r#   rp   Lexer.get_tokens_unprocessed  s
     "!r%   )r?   r=   rB   rC   r<   r;   r>   )F)r2   r3   r4   r5   r6   r.   aliases	filenamesalias_filenames	mimetypespriorityurlversion_added_examplerH   rN   rE   r*   rk   rw   rp   r7   r!   r%   r#   r   r   1   sl    8v D G
 I O I H C M H%<B%"/b0	"r%   r   )	metaclassc                   *    \ rS rSrSr\4S jrS rSrg)r   i#  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    U" S0 UD6U l         U" S0 UD6U l        X0l        [        R                  " U 40 UD6  g Nr!   )
root_lexerlanguage_lexerneedler   rH   )rF   _root_lexer_language_lexer_needlerC   s        r#   rH   DelegatingLexer.__init__-  s7    %00-88t'w'r%   c                    Sn/ n/ nU R                   R                  U5       HR  u  pVnX`R                  L a+  U(       a  UR                  [	        U5      U45        / nX'-  nM?  UR                  XVU45        MT     U(       a  UR                  [	        U5      U45        [        UU R                  R                  U5      5      $ )N )r   rp   r   rR   r_   do_insertionsr   )rF   rU   buffered
insertions
lng_bufferirq   rr   s           r#   rp   &DelegatingLexer.get_tokens_unprocessed3  s    

**AA$GGA!KK%%s8}j&AB!#J!!1), H s8}j9:Z!__CCHMO 	Or%   )r   r   r   N)	r2   r3   r4   r5   r6   r   rH   rp   r7   r!   r%   r#   r   r   #  s     >C (Or%   r   c                       \ rS rSrSrSrg)r   iJ  zA
Indicates that a state should include rules from another state.
r!   Nr2   r3   r4   r5   r6   r7   r!   r%   r#   r   r   J  s     	r%   r   c                       \ rS rSrSrS rSrg)_inheritiQ  z;
Indicates the a state should inherit from its superclass.
c                     g)Nr   r!   rM   s    r#   rN   _inherit.__repr__U  s    r%   r!   N)r2   r3   r4   r5   r6   rN   r7   r!   r%   r#   r   r   Q  s    r%   r   c                   $    \ rS rSrSrS rS rSrg)combinedi[  z2
Indicates a state combined from multiple states.
c                 ,    [         R                  X5      $ ro   )tupler,   )clsargss     r#   r,   combined.__new__`  s    }}S''r%   c                     g ro   r!   )rF   r   s     r#   rH   combined.__init__c  s    r%   r!   N)r2   r3   r4   r5   r6   r,   rH   r7   r!   r%   r#   r   r   [  s    (r%   r   c                   H    \ rS rSrSrS rSS jrSS jrSS jrS r	S	 r
S
rg)_PseudoMatchih  z2
A pseudo match object constructed from a string.
c                     X l         Xl        g ro   )_text_start)rF   startrU   s      r#   rH   _PseudoMatch.__init__m  s    
r%   Nc                     U R                   $ ro   )r   rF   args     r#   r   _PseudoMatch.startq  s    {{r%   c                 F    U R                   [        U R                  5      -   $ ro   )r   r_   r   r   s     r#   end_PseudoMatch.endt  s    {{S_,,r%   c                 >    U(       a  [        S5      eU R                  $ )NzNo such group)
IndexErrorr   r   s     r#   group_PseudoMatch.groupw  s    _--zzr%   c                     U R                   4$ ro   )r   rM   s    r#   groups_PseudoMatch.groups|  s    

}r%   c                     0 $ ro   r!   rM   s    r#   	groupdict_PseudoMatch.groupdict  s    	r%   )r   r   ro   )r2   r3   r4   r5   r6   rH   r   r   r   r   r   r7   r!   r%   r#   r   r   h  s%    -
r%   r   c                     ^  SU 4S jjnU$ )zD
Callback that yields multiple actions for each group in the match.
c           
   3     >#    [        T5       H  u  p4Uc  M
  [        U5      [        L a7  UR                  US-   5      nU(       a  UR	                  US-   5      XE4v   MQ  MS  UR                  US-   5      nUc  Ml  U(       a  UR	                  US-   5      Ul        U" U [        UR	                  US-   5      U5      U5       H  nU(       d  M  Uv   M     M     U(       a  UR                  5       Ul        g g 7f)N   )	enumerater+   r
   r   r   posr   r   )lexermatchctxr   actiondataitemr   s          r#   callbackbygroups.<locals>.callback  s     "4IA~f+{{1q5)++a!e,f::  {{1q5)#"'++a!e"4 &u'3EKKA4F'Ms!T4"&J!T )  iikCG s   A4C7;AC7*C7ro   r!   )r   r   s   ` r#   r   r     s    "& Or%   c                       \ rS rSrSrSrg)_Thisi  zL
Special singleton used for indicating the caller class.
Used by ``using``.
r!   Nr   r!   r%   r#   r   r     s    r%   r   c                    ^ ^^ 0 mST;   a9  TR                  S5      n[        U[        [        45      (       a  UTS'   OSU4TS'   T [        L a  SUU4S jjnU$ SU UU4S jjnU$ )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   <  >#    T	(       a.  T	R                  U R                  5        U R                  " S0 T	D6nOU nUR                  5       nUR                  " UR                  5       40 TD6 H  u  pVnXT-   Xg4v   M     U(       a  UR                  5       Ul        g g 7fr   )updaterC   rL   r   rp   r   r   r   )
r   r   r   lxsr   rq   rr   	gt_kwargskwargss
           r#   r   using.<locals>.callback  s      emm,__.v.A44U[[]PiPaeQk! Q))+ s   BBc              3     >#    T
R                  U R                  5        T" S0 T
D6nUR                  5       nUR                  " UR	                  5       40 T	D6 H  u  pVnXT-   Xg4v   M     U(       a  UR                  5       Ul        g g 7fr   )r   rC   r   rp   r   r   r   )r   r   r   r   r   r   rq   rr   _otherr   r   s           r#   r   r     st     MM%--(!&!BA44U[[]PiPaeQk! Q))+ s   BBro   )poprQ   listr   r   )r   r   r   r   r   s   ``  @r#   r   r     sr     I&JJwa$''!"Ig"(!Ig~	& 	&2 O		& 		& Or%   c                       \ rS rSrSrS rSrg)r   i  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                     Xl         g ro   r   )rF   r   s     r#   rH   default.__init__  s    
r%   r   N)r2   r3   r4   r5   r6   rH   r7   r!   r%   r#   r   r     s    r%   r   c                   (    \ rS rSrSrSS jrS rSrg)r   i  z
Indicates a list of literal words that is transformed into an optimized
regex that matches any of the words.

.. versionadded:: 2.0
c                 (    Xl         X l        X0l        g ro   )r   prefixsuffix)rF   r   r   r   s       r#   rH   words.__init__  s    
r%   c                 T    [        U R                  U R                  U R                  S9$ )Nr   r   )r   r   r   r   rM   s    r#   rD   	words.get  s    DKKLLr%   )r   r   r   N)r   r   )r2   r3   r4   r5   r6   rH   rD   r7   r!   r%   r#   r   r     s    
Mr%   r   c                   F    \ rS rSrSrS rS rS rS rSS jr	S	 r
S
 rSrg)RegexLexerMetai  zk
Metaclass for RegexLexer, creates the self._tokens attribute from
self.tokens on the first instantiation.
c                     [        U[        5      (       a  UR                  5       n[        R                  " X5      R
                  $ )zBPreprocess the regular expression component of a token definition.)rQ   r   rD   recompiler   )r   regexrflagsr   s       r#   _process_regexRegexLexerMeta._process_regex  s/    eV$$IIKEzz%(...r%   c                 `    [        U5      [        L d  [        U5      (       d   SU< 35       eU$ )z5Preprocess the token component of a token definition.z0token type must be simple type or callable, not )r+   r
   callable)r   tokens     r#   _process_tokenRegexLexerMeta._process_token   s4    E{j(HUOO 	I>uiH	I;r%   c                    [        U[        5      (       a:  US:X  a  gX;   a  U4$ US:X  a  U$ USS S:X  a  [        USS 5      * $  SU< 35       e[        U[        5      (       ag  SU R                  -  nU =R                  S	-  sl        / nU H4  nXa:w  d   S
U< 35       eUR                  U R                  UX65      5        M6     XSU'   U4$ [        U[        5      (       a"  U H  nXb;   a  M
  US;   a  M   SU-   5       e   U$  SU< 35       e)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 )rQ   r[   intr   _tmpnameextend_process_stater   )r   	new_stateunprocessed	processed	tmp_stateitokensistates          r#   _process_new_state!RegexLexerMeta._process_new_state  sD   i%%F")!|#g%  2A')IabM***@ 29-@@u	8,,!CLL0ILLALG#*L.A&,LL*s11+2; E F $ $+i <	5))#-"332(612 4 $ @29-@@5r%   c                    [        U[        5      (       d   SU< 35       eUS   S:w  d   SU< 35       eX2;   a  X#   $ / =oBU'   U R                  nX    GHR  n[        U[        5      (       a<  Xc:w  d   SU< 35       eUR	                  U R                  X[        U5      5      5        MU  [        U[        5      (       a  Ml  [        U[        5      (       aP  U R                  UR                  X5      nUR                  [        R                  " S5      R                  SU45        M  [        U5      [        L d   SU< 35       e U R!                  US   XS5      nU R'                  US   5      n
[)        U5      S:X  a  SnOU R                  US   X5      nUR                  XU45        GMU     U$ ! ["         a#  n	[%        S	US   < S
U< SU < SU	 35      U	eSn	A	ff = f)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      )rQ   r[   flagsr   r   r   r   r   r  r   rR   r   r   r   r+   r   r   	Exception
ValueErrorr   r_   )r   r   r  r   tokensr   tdefr   rexerrr   s              r#   r   RegexLexerMeta._process_state)  s   %%%D):5)'DD%Qx3?"5eY ??##$&&5!&D$((}K(A%&KK}c0014T< =$)) $((224::{V	rzz"~33T9EF:&B/$(BB&r((a&@ &&tAw/E4yA~ 	22473>K	 MM3y12A 'B   r #6tAwkE9TXY\X__abeaf!ghnqqrs   F--
G7GGNc                     0 =o0R                   U'   U=(       d    U R                  U   n[        U5       H  nU R                  X#U5        M     U$ )z-Preprocess a dictionary of token definitions.)_all_tokensr  r   r   )r   r.   	tokendefsr  r   s        r#   process_tokendefRegexLexerMeta.process_tokendefT  sJ    ,..	OOD)1D!1	)_EyU; %r%   c                    0 n0 nU R                    H  nUR                  R                  S0 5      nUR                  5        Hr  u  pVUR                  U5      nUc   XaU'    UR	                  [
        5      nXU'   M9  UR                  US5      nUc  MP  XgXS-   &  UR	                  [
        5      n	X-   X%'   Mt     M     U$ ! [         a     M  f = f! [         a     M  f = f)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__rD   itemsindexr   r  r   )
r   r  inheritablectoksr   r  curitemsinherit_ndxnew_inh_ndxs
             r#   get_tokendefsRegexLexerMeta.get_tokendefs\  s     A::>>(B/D $

!::e,#
 %*5M!&+kk'&: *5&)ooeT:& 7<]3C #(++g"6K *5)BK&9 !- B ) & ! ! " s$   B<C<
C
	C

CCc                    SU R                   ;  aV  0 U l        SU l        [        U S5      (       a  U R                  (       a  O%U R                  SU R                  5       5      U l        [        R                  " U /UQ70 UD6$ )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(  RegexLexerMeta.__call__  sk    CLL( COCLs,--#2D2D!222s7H7H7JK}}S040400r%   r!   ro   )r2   r3   r4   r5   r6   r   r   r  r   r  r"  r(  r7   r!   r%   r#   r   r     s.    
/!AF)V/b1r%   r   c                   >    \ rS rSrSr\R                  r0 rSS jr	Sr
g)r   i  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              #   n  #    SnU R                   n[        U5      nXES      n U GH>  u  pxn	U" X5      n
U
(       d  M  Ub7  [        U5      [        L a  X8U
R	                  5       4v   OU" X
5       Sh  vN   U
R                  5       nU	b  [        U	[        5      (       a`  U	 HY  nUS:X  a#  [        U5      S:  a  UR                  5         M*  M,  US:X  a  UR                  US   5        MH  UR                  U5        M[     O^[        U	[        5      (       a#  [        U	5      [        U5      :  a  USS2	 O+XYS2	 O&U	S:X  a  UR                  US   5        O SU	< 35       eXES      n  O8    X   S:X  a  S	/nUS	   nU[        S4v   US-  nGMj  U[        X   4v   US-  nGM~   GN/! [         a     gf = f7f)
zf
Split ``text`` into (tokentype, text) pairs.

``stack`` is the initial stack (default: ``['root']``)
r   r   r   Nr   r   wrong state def: rY   r   )r%  r   r+   r
   r   r   rQ   r   r_   r   rR   r   absr	   r   r   )rF   rU   r   r   r  
statestackstatetokensrexmatchr   r   mr   s               r#   rp   !RegexLexer.get_tokens_unprocessed  s     LL	%[
2//:+)T'1)<:5"%qwwy"88'-d66%%'C ,%i77)2#(F?'*:':(2(8 (;%*g%5$.$5$5jn$E$.$5$5e$< *3 (	377  #9~Z@$.qrN$.z$:&'1&--jn=K,=i]*KK5&/2&?C 0;JyD(&,X
&/&7!:t33q udi//1HC_  7P " sG   8F55F53F"4C5F5* F% 
F5F% F5%
F2/F51F22F5r!   N)r   )r2   r3   r4   r5   r6   r   	MULTILINEr
  r  rp   r7   r!   r%   r#   r   r     s     LLE0 F;r%   r   c                   (    \ rS rSrSrSS jrS rSrg)r   i  z1
A helper object that holds lexer position data.
Nc                 p    Xl         X l        U=(       d    [        U5      U l        U=(       d    S/U l        g )Nr   )rU   r   r_   r   r   )rF   rU   r   r   r   s        r#   rH   LexerContext.__init__  s*    	##d)&vh
r%   c                 \    SU R                   < SU R                  < SU R                  < S3$ )NzLexerContext(z, ))rU   r   r   rM   s    r#   rN   LexerContext.__repr__  s)    tyym2dhh\DJJ>KKr%   )r   r   r   rU   NN)r2   r3   r4   r5   r6   rH   rN   r7   r!   r%   r#   r   r     s    'Lr%   r   c                   "    \ rS rSrSrSS jrSrg)r   i  z=
A RegexLexer that uses a context object to store its state.
Nc              #     #    U R                   nU(       d  [        US5      nUS   nOUnX4R                  S      nUR                  n U GH  u  pgnU" XR                  UR
                  5      n	U	(       d  M-  Ubo  [        U5      [        L a4  UR                  XyR                  5       4v   U	R                  5       Ul        O)U" X	U5       Sh  vN   U(       d  X4R                  S      nUGbI  [        U[        5      (       a  U H  n
U
S:X  a7  [        UR                  5      S:  a  UR                  R                  5         M>  M@  U
S:X  a*  UR                  R                  UR                  S   5        Mp  UR                  R                  U
5        M     O[        U[        5      (       aB  [        U5      [        UR                  5      :  a  UR                  SS2	 OJUR                  US2	 O:US:X  a)  UR                  R                  UR                  S   5        O SU< 35       eX4R                  S      n  O    UR                  UR
                  :  a  gXR                     S	:X  a:  S/Ul        US   nUR                  [         S	4v   U=R                  S-  sl        GM[  UR                  ["        XR                     4v   U=R                  S-  sl        GM   GN! [$         a     gf = f7f)
zg
Split ``text`` into (tokentype, text) pairs.
If ``context`` is given, use this lexer context instead.
r   r   r   r   Nr   r   r-  rY   )r%  r   r   rU   r   r   r+   r
   r   rQ   r   r_   r   rR   r   r.  r   r   r   )rF   rU   contextr  r   r0  r1  r   r   r2  r   s              r#   rp   )ExtendedRegexLexer.get_tokens_unprocessed  sg    
 LL	tQ'C#F+KC#IIbM2K88D/:+)T77CGG41)<:5"%''6779"<<&'eegCG'-ds';;;#,.7		".F ,%i77)2#(F?'*399~'9(+		 (:%*g%5$'II$4$4SYYr]$C$'II$4$4U$; *3 (	377"9~SYY?$'IIabM$'IIij$9&'1II,,SYYr];K,=i]*KK5&/		"&>G 0;Jww#'')GG},%+H	&/&7!ggtT111 ''5$ww-77GGqLGc  <R " sW   A1K.7AK.KE-K.;K K.A	K K."6K K.
K+(K.*K++K.r!   r<  )r2   r3   r4   r5   r6   rp   r7   r!   r%   r#   r   r     s    @r%   r   c              #     #    [        U 5      n  [        U 5      u  p#SnSnU H  u  pgnUc  UnSn	U(       a  U[        U5      -   U:  an  XX&-
   n
U
(       a  XGU
4v   U[        U
5      -  nU H  u  pnXLU4v   U[        U5      -  nM     X&-
  n	 [        U 5      u  p#U(       a  U[        U5      -   U:  a  Mn  U	[        U5      :  d  M  XGXS 4v   U[        U5      U	-
  -  nM     U(       aC  U=(       d    SnU H  u  pnXGU4v   U[        U5      -  nM      [        U 5      u  p#U(       a  MB  gg! [         a    U Sh  vN     gf = f! [         a    Sn M  f = f! [         a    Sn gf = f7f)aC  
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StopIterationr_   )r   r  r  r  realposinsleftr   rq   rr   olditmpvalit_indexit_tokenit_valueps                  r#   r   r   S  s     j!Jj) GG a?G!c!f*-EI&F&((3v;&07,H113x=( 18 9D!%j!1 !c!f*- #a&=ah&&s1v}$G+ 0 ,QGA!a-s1vG 	!*-NE 'E  4 !    	G	s   E/D/ A1E/E
E/6E/AE/E $E/-E//E>E?EE/EE/
EE/EE/E,)E/+E,,E/c                       \ rS rSrSrS rSrg)ProfilingRegexLexerMetai  z>Metaclass for ProfilingRegexLexer, collects regex timing info.c                    ^ ^^^ [        U[        5      (       a*  [        UR                  UR                  UR                  S9mOUm[
        R                  " TU5      m[        R                  4U UUU4S jjnU$ )Nr   c                    > TR                   S   R                  T
T	4SS/5      n[        R                  " 5       nTR                  XU5      n[        R                  " 5       nUS==   S-  ss'   US==   Xd-
  -  ss'   U$ )Nr   r   r    r   )
_prof_data
setdefaulttimer   )rU   r   endposinfot0rest1r   compiledr  r   s          r#   
match_func:ProfilingRegexLexerMeta._process_regex.<locals>.match_func  sn    >>"%00%3xHDB..F3CBGqLGGrwGJr%   )	rQ   r   r   r   r   r   r   sysmaxsize)r   r   r   r   rZ  rY  r  s   `  ` @@r#   r   &ProfilingRegexLexerMeta._process_regex  s]    eU##EKK#(<<1C C::c6*), 	 	 r%   r!   N)r2   r3   r4   r5   r6   r   r7   r!   r%   r#   rN  rN    s
    Hr%   rN  c                   *    \ rS rSrSr/ rSrSS jrSrg)ProfilingRegexLexeri  zFDrop-in replacement for RegexLexer that does profiling of its regexes.   c              #   H  ^ #    T R                   R                  R                  0 5        [        R	                  T X5       S h  vN   T R                   R                  R                  5       n[        S UR                  5        5       U 4S jSS9n[        S U 5       5      n[        5         [        ST R                   R                  [        U5      U4-  5        [        S5        [        SS	-  5        [        S
5        U H  n[        SU-  5        M     [        S5        g  N7f)Nc              3      #    U  HG  u  u  pu  p4U[        U5      R                  S 5      R                  SS5      SS USU-  SU-  U-  4v   MI     g7f)zu'z\\\NA   i  )reprrc   rb   ).0r   rnrq   s        r#   	<genexpr>=ProfilingRegexLexer.get_tokens_unprocessed.<locals>.<genexpr>  s\      @/>+FQFQ 47==/77EcrJ4!8TAX\3/>s   AAc                 "   > U TR                      $ ro   )_prof_sort_index)r"   rF   s    r#   r$   <ProfilingRegexLexer.get_tokens_unprocessed.<locals>.<lambda>  s    Ad&;&;$<r%   T)keyreversec              3   *   #    U  H	  oS    v   M     g7f)   Nr!   )rg  r"   s     r#   rj  rk    s     +d!ds   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)rL   rQ  rR   r   rp   r   sortedr  sumprintr2   r_   )rF   rU   r   rawdatar   	sum_totalr0   s   `      r#   rp   *ProfilingRegexLexer.get_tokens_unprocessed  s     !!((,44T4GGG..++//1 @/6}}@ ="	$
 +d++	B~~&&D	9=> 	?i47IIJiA/!34 i# 	Hs   ?D"D CD"r!   Nr4  )	r2   r3   r4   r5   r6   rQ  rm  rp   r7   r!   r%   r#   r`  r`    s    PJr%   r`  )6r6   r   r\  rS  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   rN  r`  r!   r%   r#   <module>r     sJ   
 
  = ; Q Q* * 3* **W
,  . 	1 	1o"i o"dOe ON	c 	  *
u 
 64  w/d	 	MF M d1Y d1N^. ^BL LE EP=@n ,*0G r%   