+
     h  c                   sZ   R t ^ RIt^ RIt^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
HtHtHtHt ^ RIHtHtHtHtHtHt ^ RIHt . R-Ot]P2                  ! R4      t. R.Ot]! R 4      t ! R R]4      t ! R R]R7      t  ! R R
] 4      t! ! R R]"4      t# ! R R4      t$]$! 4       t% ! R R]&4      t' ! R R4      t(R t) ! R R4      t*]*! 4       t+R  t, ! R! R4      t- ! R" R]4      t. ! R# R$]4      t/ ! R% R] ]/R7      t0 ! R& R4      t1 ! R' R	]04      t2R( t3 ! R) R*]/4      t4 ! R+ R,]0]4R7      t5R# )/z
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defaultwordsz.*?
c                     R # )         )x   &?/usr/lib/python3.14/site-packages/pip/_vendor/pygments/lexer.py<lambda>r   "   s    #    c                   s*   a  ] tR t^%t o RtR tRtV tR# )	LexerMetazv
This metaclass automagically converts ``analyse_text`` methods into
static methods which always return float values.
c                sf    R V9   d   \        VR ,          4      VR &   \        P                  WW#4      # )analyse_text)r   type__new__)ZmcsnameZbasesd   &&&&r   r"   ZLexerMeta.__new__+   s/    Q /.0A BAn||Cu00r   r   N)__name__
__module____qualname____firstlineno____doc__r"   __static_attributes____classdictcell__Z__classdict__   @r   r   r   %   s     
1 1r   r   c                   sv   a  ] tR t^1t o RtRt. t. t. t. t	^ t
RtRtRtR tR tR tR tR tRR ltR	 tR
tV tR# )r   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.
Nc                s|   Wn         \        VRR4      V n        \        VRR4      V n        \        VRR4      V n        \        VR^ 4      V n        VP                  RR4      V n        VP                  R	4      ;'       g    V P                  V n        . V n	        \        VR
R4       F  pV P                  V4       K  	  R# )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tabsizeencodingguessZ
inencodingfiltersNr   )optionsr   r/   r0   r1   r	   r2   getr3   r5   r
   
add_filter)selfr6   filter_s   &, r   __init__ZLexer.__init__   s    & #GY=$Wj%@$Wj$?"7Iq9J8L1BBT]]#GY;GOOG$ <r   c                s    V P                   '       d)   R V P                  P                   RV P                   : R2# R V P                  P                   R2# )z<pygments.lexers.z with Z>)r6   	__class__r&   r9   r   r   __repr__ZLexer.__repr__   sK    <<<&t~~'>'>&?vdllEUUVWW&t~~'>'>&?qAAr   c                s    \        V\        4      '       g   \        V3/ VB pV P                  P	                  V4       R# )z(
Add a new stream filter to this lexer.
N)
isinstancer   r   r5   append)r9   r:   r6   s   &&,r   r8   ZLexer.add_filter   s2     '6**(<G<GG$r   c                s    R# )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   )textr   r   r    ZLexer.analyse_text   s    r   c                sD   \        V\        4      '       g~   V P                  R8X  d   \        V4      w  rMV P                  R8X  d    \	        R4      hVP                  V P                  4      pVP                  R4      '       d   V\        R4      R pM%VP                  R4      '       d   V\        R4      R pVP                  RR4      pVP                  R	R4      pV P                  '       d   VP                  4       pM#V P                  '       d   VP                  R4      pV P                   ^ 8  d   VP#                  V P                   4      pV P$                  '       d!   VP'                  R4      '       g
   VR,          pV#   \         d   p\	        R4      ThRp?ii ; i)
zVApply preprocessing such as decoding the input, removing BOM and normalizing newlines.r4   chardetzchardet is not vendored by pipzkTo enable chardet encoding guessing, please install the chardet library from http://chardet.feedparser.org/Nu   ﻿z

Z)r?   strr3   r   ZImportError_encoding_mapZ
startswithlenZdecoderB   Zdetectr7   replacer0   stripr/   r2   Z
expandtabsr1   Zendswith)r9   rA   _ZeZdecodedZbomr3   Zenc   &&      r   _preprocess_lexer_inputZLexer._preprocess_lexer_input   s[    $$$}}'&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   F FFFc                s   a a S P                  S4      oV V3R lpV! 4       pV'       g   \        VS P                  S 4      pV# )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   sP   <"   SP                  S4       F  w  rpW3x  K  	  R # 5iN)get_tokens_unprocessed)rI   tvr9   rA   s      r   streamerZ"Lexer.get_tokens.<locals>.streamer  s&     66t<ad
 =s   #&)rK   r    r5   )r9   rA   Z
unfilteredrP   Zstreams   ff&  r   
get_tokensZLexer.get_tokens   s=     ++D1	 "64<<>Fr   c                s    \         h)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.
)ZNotImplementedError)r9   rA      &&r   rM   ZLexer.get_tokens_unprocessed  s
     "!r   )r3   r1   r5   r6   r0   r/   r2   )F)r&   r'   r(   r)   r*   r#   ZaliasesZ	filenamesZalias_filenamesZ	mimetypesZpriorityZurlZversion_addedZ_exampler;   r>   r8   r    rK   rQ   rM   r+   r,   r-   r.   r   r   r   1   st     8v D G
 I O I H C M H%<B%"/b0	" 	"r   )Z	metaclassc                   s6   a  ] tR tRt o Rt]3R ltR tRtV t	R# )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                st    V! R/ VB V n         V! R/ VB V n        W0n        \        P                  ! V 3/ VB  R # Nr   )
root_lexerlanguage_lexerneedler   r;   )r9   Z_root_lexerZ_language_lexerZ_needler6   s   &&&&,r   r;   ZDelegatingLexer.__init__-  s7    %00-88t'w'r   c                s   R p. p. pV P                   P                  V4       FX  w  rVpW`P                  J d1   V'       d   VP                  \	        V4      V34       . pW',          pKE  VP                  WVV34       KZ  	  V'       d   VP                  \	        V4      V34       \        VV P                  P                  V4      4      # ) )rU   rM   rV   r@   rF   do_insertionsrT   )r9   rA   Zbuffered
insertionsZ
lng_bufferirN   rO   rJ   r   rM   Z&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   )rU   rV   rT   N)
r&   r'   r(   r)   r*   r   r;   rM   r+   r,   r-   r.   r   r   r   #  s!      >C (O Or   c                       ] tR tRtRtRtR# )r   iJ  zA
Indicates that a state should include rules from another state.
r   Nr&   r'   r(   r)   r*   r+   r   r   r   r   r   J  s     	r   c                   *   a  ] tR tRt o RtR tRtV tR# )_inheritiQ  z;
Indicates the a state should inherit from its superclass.
c                r   )inheritr   r=   r   r   r>   Z_inherit.__repr__U  s    r   r   N)r&   r'   r(   r)   r*   r>   r+   r,   r-   r.   r   r^   r^   Q  s      r   r^   c                   s0   a  ] tR tRt o RtR tR tRtV tR# )combinedi[  z2
Indicates a state combined from multiple states.
c                s,    \         P                  W4      # rL   )tupler"   )clsargs   &*r   r"   Zcombined.__new__`  s    }}S''r   c                r   rL   r   )r9   rc   rd   r   r;   Zcombined.__init__c  s    r   r   N)	r&   r'   r(   r)   r*   r"   r;   r+   r,   r-   r.   r   r`   r`   [  s     ( r   r`   c                   sT   a  ] tR tRt o RtR tRR ltRR ltRR ltR t	R	 t
R
tV tR# )_PseudoMatchih  z2
A pseudo match object constructed from a string.
c                s    W n         Wn        R # rL   )_text_start)r9   startrA   s   &&&r   r;   Z_PseudoMatch.__init__m  s    
r   Nc                s    V P                   # rL   )rg   r9   ZargrR   r   rh   Z_PseudoMatch.startq  s    {{r   c                sN    V P                   \        V P                  4      ,           # rL   )rg   rF   rf   ri   rR   r   endZ_PseudoMatch.endt  s    {{S_,,r   c                s@    V'       d   \        R 4      hV P                  # )zNo such group)
IndexErrorrf   ri   rR   r   groupZ_PseudoMatch.groupw  s    _--zzr   c                s    V P                   3# rL   )rf   r=   r   r   groupsZ_PseudoMatch.groups|  s    

}r   c                s    / # rL   r   r=   r   r   	groupdictZ_PseudoMatch.groupdict  s    	r   )rg   rf   rL   )r&   r'   r(   r)   r*   r;   rh   rj   rl   rm   rn   r+   r,   r-   r.   r   re   re   h  s-     -
 r   re   c                 s   a  RV 3R llpV# )zD
Callback that yields multiple actions for each group in the match.
c           
   3   s,  <"   \        S4       F  w  r4Vf   K  \        V4      \        J dA   VP                  V^,           4      pV'       d   VP	                  V^,           4      WE3x  K\  K^  VP                  V^,           4      pVf   K|  V'       d   VP	                  V^,           4      Vn        V! V \        VP	                  V^,           4      V4      V4       F  pV'       g   K  Vx  K  	  K  	  V'       d   VP                  4       Vn        R # R # 5irL   )Z	enumerater!   r   rl   rh   posre   rj   )lexermatchctxrZ   actiondataZitemrc   s   &&&    r   callbackZ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%   A	D9DDAD'D;DrL   r   )rc   ru   s   j r   bygroupsrv     s    "& Or   c                   r[   )_Thisi  zL
Special singleton used for indicating the caller class.
Used by ``using``.
r   Nr\   r   r   r   rw   rw     s    r   rw   c                s   a aa / oRS9   d;   SP                  R4      p\        V\        \        34      '       d   VSR&   MRV3SR&   S \        J d   RVV3R llpV# RV VV3R llpV# )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   sL  <"   S	'       d/   S	P                  V P                  4       V P                  ! R/ S	B pMT pVP                  4       pVP                  ! VP                  4       3/ SB  F  w  rVpWT,           Wg3x  K  	  V'       d   VP                  4       Vn        R # R # 5irS   )updater6   r<   rh   rM   rl   rj   ro   )
rp   rq   rr   lxsrZ   rN   rO   	gt_kwargskwargss
   &&&     r   ru   using.<locals>.callback  s      emm,__.v.A44U[[]PiPaeQk! Q))+ s   BB$B$c              3   s"  <"   S
P                  V P                  4       S! R/ S
B pVP                  4       pVP                  ! VP	                  4       3/ S	B  F  w  rVpWT,           Wg3x  K  	  V'       d   VP                  4       Vn        R # R # 5irS   )r{   r6   rh   rM   rl   rj   ro   )rp   rq   rr   r|   r}   rZ   rN   rO   _otherr~   r   s   &&&     r   ru   r     st     MM%--(!&!BA44U[[]PiPaeQk! Q))+ s   A2B6BrL   )popr?   listra   this)r   r   r}   ru   r~   s   fl  @r   usingr     sr     I&JJwa$''!"Ig"(!Ig~	& 	&2 O		& 		& Or   c                   r]   )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                s    Wn         R # rL   rx   )r9   rx   rR   r   r;   Zdefault.__init__  s    
r   r   N)r&   r'   r(   r)   r*   r;   r+   r,   r-   r.   r   r   r     s      r   c                   s4   a  ] tR tRt o RtRR ltR tRtV tR# )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                s*    Wn         W n        W0n        R # rL   )r   prefixsuffix)r9   r   r   r   r%   r   r;   Zwords.__init__  s    
r   c                sZ    \        V P                  V P                  V P                  R 7      # )r   r   )r   r   r   r   r=   r   r   r7   Z	words.get  s    DKKLLr   )r   r   r   N)rW   rW   )	r&   r'   r(   r)   r*   r;   r7   r+   r,   r-   r.   r   r   r     s     
M Mr   c                   sR   a  ] tR tRt o RtR tR tR tR tRR lt	R	 t
R
 tRtV tR# )RegexLexerMetai  zk
Metaclass for RegexLexer, creates the self._tokens attribute from
self.tokens on the first instantiation.
c                s    \        V\        4      '       d   VP                  4       p\        P                  ! W4      P
                  # )zBPreprocess the regular expression component of a token definition.)r?   r   r7   recompilerq   )rb   regexrflagsrx   r%   r   _process_regexZRegexLexerMeta._process_regex  s/    eV$$IIKEzz%(...r   c                sd    \        V4      \        J g   \        V4      '       g   Q RV: 24       hV# )z5Preprocess the token component of a token definition.z0token type must be simple type or callable, not )r!   r   Zcallable)rb   tokenrR   r   _process_tokenZRegexLexerMeta._process_token   s4    E{j(HUOO 	I>uiH	I;r   c                sZ   \        V\        4      '       dH   VR8X  d   R
# W9   d   V3# VR8X  d   V# VR,          R8X  d   \        VR,          4      ) # Q RT: 24       h\        V\        4      '       dq   RV P                  ,          pV ;P                  ^,          un        . pV F5  pWa8w  g   Q RV: 24       hVP                  V P                  VW64      4       K7  	  WSV&   V3# \        V\        4      '       d)   V F   pWb9   d   K  VR9   d   K  Q RV,           4       h	  V# Q R	T: 24       h)z=Preprocess the state transition action of a token definition.#pop#push:N   Nz#pop::r   NNzunknown new state z_tmp_%dzcircular state ref zunknown new state def )r   r   )r?   rD   intr`   _tmpnameextend_process_statera   )rb   	new_stateunprocessed	processedZ	tmp_stateitokensZistates   &&&&   r   _process_new_stateZ!RegexLexerMeta._process_new_state  sB   i%%F"	)!|#g%  2')IbM***@ 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                s   \        V\        4      '       g   Q RV: 24       hV^ ,          R8w  g   Q RV: 24       hW29   d	   W#,          # . ;qBV&   V P                  pW,           EFd  p\        V\        4      '       d>   Wc8w  g   Q RV: 24       hVP	                  V P                  W\        V4      4      4       KW  \        V\        4      '       d   Ko  \        V\        4      '       dQ   V P                  VP                  W4      pVP                  \        P                  ! R4      P                  RV34       K  \        V4      \        J g   Q RV: 24       h V P!                  V^ ,          WS4      pT P'                  T^,          4      p
\)        T4      ^8X  d   RpMT P                  T^,          Y4      pTP                  YT34       EKg  	  V#   \"         d(   p	\%        RT^ ,          : R	T: R
T : RT	 24      T	hRp	?	ii ; i)z%Preprocess a single state definition.zwrong state name Z#zinvalid state name zcircular state reference rW   Nzwrong rule def zuncompilable regex z
 in state z of z: )r?   rD   flagsr   r   r   r^   r   r   rx   r@   r   r   rq   r!   ra   r   Z	Exception
ValueErrorr   rF   )rb   r   r   rx   tokensr   Ztdefr   rexZerrr   s   &&&&       r   r   Z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   GH "G;;H Nc                s    / ;q0P                   V&   T;'       g    V P                  V,          p\        V4       F  pV P                  W#V4       K  	  V# )z-Preprocess a dictionary of token definitions.)_all_tokensr   r   r   )rb   r#   	tokendefsr   rx   s   &&&  r   process_tokendefZRegexLexerMeta.process_tokendefT  sM    ,..	OOD)11D!1	)_EyU; %r   c                s   / p/ pV P                    F  pVP                  P                  R/ 4      pVP                  4        F|  w  rVVP                  V4      pVf!   WaV&    VP	                  \
        4      pYT&   K:  VP                  VR4      pVf   KR  WgW^,           %  VP	                  \
        4      p	W,           W%&   K~  	  K  	  V#   \         d     K  i ; i  \         d     K  i ; i)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   N)Z__mro____dict__r7   itemsindexr_   r   r   )
rb   r   ZinheritableZcZtoksrx   r   ZcuritemsZinherit_ndxZnew_inh_ndxs
   &         r   get_tokendefsZRegexLexerMeta.get_tokendefs\  s     A::>>(B/D $

!::e,#
 %*5M!&+kk'&: *5&)ooeT:& 7<]3C #(++g"6K *5)BK&9 !- B ) & ! ! " s$   CCCCC'&C'c                s   RV P                   9  dY   / V n        ^ V n        \        V R4      '       d   V P                  '       d   M%V P                  RV P                  4       4      V n        \        P                  ! V .VO5/ VB # )z:Instantiate cls after preprocessing its token definitions._tokenstoken_variantsrW   )
r   r   r   Zhasattrr   r   r   r   r!   __call__)rb   rc   Zkwdss   &*,r   r   ZRegexLexerMeta.__call__  sn    CLL( COCLs,--#2D2D2D!222s7H7H7JK}}S040400r   r   rL   )r&   r'   r(   r)   r*   r   r   r   r   r   r   r   r+   r,   r-   r.   r   r   r     s6     
/!AF)V/b1 1r   r   c                   sJ   a  ] tR tRt o Rt]P                  t/ tRR lt	Rt
V tR# )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              #  s  "   ^ pV P                   p\        V4      pWER,          ,          p V EFY  w  rxp	V! W4      p
V
'       g   K  Ve9   \        V4      \        J d   W8V
P	                  4       3x  MV! W
4       Rj  xL
  V
P                  4       pV	e   \        V	\        4      '       dh   V	 F`  pVR8X  d%   \        V4      ^8  d   VP                  4        K,  K.  VR8X  d   VP                  VR,          4       KO  VP                  V4       Kb  	  Mc\        V	\        4      '       d#   \        V	4      \        V4      8  d   VR M0WYR1 M+V	R8X  d   VP                  VR,          4       MQ RT	: 24       hWER,          ,          p EK_  	   W,          R8X  d$   R.pVR,          pV\        R3x  V^,          pEK  V\        W,          3x  V^,          pEK   EL\  \         d     R# i ; i5i)	zf
Split ``text`` into (tokentype, text) pairs.

``stack`` is the initial stack (default: ``['root']``)
Nr   r      NNwrong state def: rC   rz   r   )r   r   r!   r   rl   rj   r?   ra   rF   r   r@   r   absr   r   rk   )r9   rA   ry   ro   r   Z
statestackstatetokensrexmatchrs   r   mrx   s   &&&         r   rM   Z!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@$.rN$.z$:&'1&--jn=K,=i]*KK5&/2&?C 0;JyD(&,X
&/&7!:t33q udi//1HCO 7P " sI   A G/7G/>G?DG/-G :G/=G G/G,(G/+G,,G/r   N)rz   )r&   r'   r(   r)   r*   r   Z	MULTILINEr   r   rM   r+   r,   r-   r.   r   r   r     s&      LLE0 F; ;r   c                   s4   a  ] tR tRt o RtRR ltR tRtV tR# )r   i  z1
A helper object that holds lexer position data.
Nc                sv    Wn         W n        T;'       g    \        V4      V n        T;'       g    R .V n        R# )rz   N)rA   ro   rF   rj   ry   )r9   rA   ro   ry   rj   s   &&&&&r   r;   ZLexerContext.__init__  s0    	###d)&&vh
r   c                s\    R V P                   : RV P                  : RV P                  : R2# )zLexerContext(z, Z))rA   ro   ry   r=   r   r   r>   ZLexerContext.__repr__  s)    tyym2dhh\DJJ>KKr   )rj   ro   ry   rA   NN)	r&   r'   r(   r)   r*   r;   r>   r+   r,   r-   r.   r   r   r     s     'L Lr   c                   s.   a  ] tR tRt o RtRR ltRtV tR# )r   i  z=
A RegexLexer that uses a context object to store its state.
Nc              #  st  "   V P                   pV'       g   \        V^ 4      pVR,          pM'TpW4P                  R,          ,          pVP                  p V EF  w  rgpV! WP                  VP
                  4      p	V	'       g   K.  Vez   \        V4      \        J d5   VP                  WyP                  4       3x  V	P                  4       Vn        M2V! W	V4       Rj  xL
  V'       g   W4P                  R,          ,          pVEe_   \        V\        4      '       d   V F  p
V
R8X  d9   \        VP                  4      ^8  d   VP                  P                  4        K@  KB  V
R8X  d/   VP                  P                  VP                  R,          4       Kw  VP                  P                  V
4       K  	  M\        V\        4      '       dB   \        V4      \        VP                  4      8  d   VP                  R MOVP                  VR1 M?VR8X  d.   VP                  P                  VP                  R,          4       MQ RT: 24       hW4P                  R,          ,          p EK  	   VP                  VP
                  8  d   R# WP                  ,          R8X  dC   R.Vn        VR,          pVP                  \         R3x  V;P                  ^,          un        EK  VP                  \"        WP                  ,          3x  V;P                  ^,          un        EK   ELG  \$         d     R# i ; i5i)	zg
Split ``text`` into (tokentype, text) pairs.
If ``context`` is given, use this lexer context instead.
rz   Nr   r   r   r   rC   r   )r   r   ry   rA   ro   rj   r!   r   rl   r?   ra   rF   r   r@   r   r   r   r   rk   )r9   rA   Zcontextr   rr   r   r   rs   r   r   rx   s   &&&        r   rM   Z)ExtendedRegexLexer.get_tokens_unprocessed  sb    
 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?$'IIbM$'IIij$9&'1II,,SYYr];K,=i]*KK5&/		"&>G 0;Jww#'')GG},%+H	&/&7!ggtT111 ''5$ww-77GGqLGGQ <R " s]   A>L8AL8L#L8)FL8,L& L8	AL& L8">L&  L8&L51L84L55L8r   r   )r&   r'   r(   r)   r*   rM   r+   r,   r-   r.   r   r   r     s     @ @r   c              #  s  "   \        V 4      p  \        V 4      w  r#RpRpT F  w  rgpTf   Tp^ p	T'       d~   T\        T4      ,           T8  dg   YY&,
           p
T
'       d   YGT
3x  T\        T
4      ,          pT F  w  rpYLT3x  T\        T4      ,          pK   	  Y&,
          p	 \        T 4      w  r#K  T	\        T4      8  g   K  YGYR 3x  T\        T4      T	,
          ,          pK  	  T'       dA   T;'       g    ^ pT F  w  rpYGT3x  T\        T4      ,          pK   	   \        T 4      w  r#KH  R#   \         d    T Rj  xL 
   R# i ; i  \         d    Rp K  i ; i  \         d    Rp R# i ; i5i)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.
NTF)ZiterZnextZStopIterationrF   )rY   r   r   r   ZrealposZinsleftrZ   rN   rO   ZoldiZtmpvalZit_indexZit_tokenZit_valueZps   &&             r   rX   rX   S  s     j!Jj) GG a?G!c!f*-EI&F&((3v;&07,H113x=( 18 9D!%j!1w #a&=ah&&s1v}$G+ 0 ,,QGA!a-s1vG 	!*-NE7 E  4 !    	G	s   E;D6 E;A-E;&E3E;,E;4E;='E;%E' 2E;6EE	EE;EE;E$ E;#E$$E;'E84E;7E88E;c                   r]   )ProfilingRegexLexerMetai  z>Metaclass for ProfilingRegexLexer, collects regex timing info.c                s   a aaa \        V\        4      '       d.   \        VP                  VP                  VP                  R 7      oMVo\
        P                  ! SV4      o\        P                  3V VVV3R llpV# )r   c                 s.  < SP                   R,          P                  S
S	3^ R.4      p\        P                  ! 4       pSP                  WV4      p\        P                  ! 4       pV^ ;;,          ^,          uu&   V^;;,          Wd,
          ,          uu&   V# )r   r   r   )
_prof_dataZ
setdefaulttimerq   )rA   ro   ZendposZinfoZt0ZresZt1rb   compiledr   rx   s   &&&    r   
match_funcZ:ProfilingRegexLexerMeta._process_regex.<locals>.match_func  sn    >>"%00%3xHDB..F3CBGqLGGrwGJr   )	r?   r   r   r   r   r   r   sysZmaxsize)rb   r   r   rx   r   r   r   s   f&&f @@r   r   Z&ProfilingRegexLexerMeta._process_regex  s]    eU##EKK#(<<1C C::c6*), 	 	 r   r   N)r&   r'   r(   r)   r*   r   r+   r,   r-   r.   r   r   r     s     H r   r   c                   s6   a  ] tR tRt o Rt. t^tRR ltRtV t	R# )ProfilingRegexLexeri  zFDrop-in replacement for RegexLexer that does profiling of its regexes.c              #  sn  a "   S P                   P                  P                  / 4       \        P	                  S W4       R j  xL
  S P                   P                  P                  4       p\        R VP                  4        4       V 3R lRR7      p\        R V 4       4      p\        4        \        RS P                   P                  \        V4      V3,          4       \        R4       \        R:R R	R
:R R24       \        R4       V F  p\        RV,          4       K  	  \        R4       R #  L5i)Nc              3   s   "   T FW  w  w  rw  r4V\        V4      P                  R 4      P                  RR4      R,          VRV,          RV,          V,          3x  KY  	  R# 5i)zu'z\\Z\:NiA   Ni  N)ZreprrH   rG   ).0r}   ZrZnrN   s   &    r   	<genexpr>=ProfilingRegexLexer.get_tokens_unprocessed.<locals>.<genexpr>  sZ      @/>+FQFQ 47==/77EcJ4!8TAX\3/>s   AA!c                 s*   < V SP                   ,          # rL   )_prof_sort_index)r   r9   s   &r   r   Z<ProfilingRegexLexer.get_tokens_unprocessed.<locals>.<lambda>  s    Ad&;&;$<r   T)ZkeyZreversec              3   s2   "   T F  q^,          x  K  	  R# 5i)i   Nr   )r   r   s   & r   r   r     s     +d!ds   z2Profiling result for %s lexing %d chars in %.3f msrx   Z20Z r   Z64z ncalls  tottime  percallz%-20s %-65s %5d %8.4f %8.4fzn==============================================================================================================zn--------------------------------------------------------------------------------------------------------------)r<   r   r@   r   rM   r   Zsortedr   ZsumZprintr&   rF   )r9   rA   ry   Zrawdatart   Z	sum_totalr$   s   f&&    r   rM   Z*ProfilingRegexLexer.get_tokens_unprocessed  s     !!((,44T4GGG..++//1 @/6}}@ ="	$
 +d++	B~~&&D	9=> 	?iIJiA/!34 i# 	Hs   ?D5D3C1D5r   Nr   )
r&   r'   r(   r)   r*   r   r   rM   r+   r,   r-   r.   r   r   r     s     PJ r   r   )r   r   r   r   r   r   r_   rv   r   r   r   r   line_re))s   ﻿zutf-8)s     zutf-32)s     zutf-32be)s   zutf-16)s   zutf-16be)6r*   r   r   r   Zpip._vendor.pygments.filterr    r   Zpip._vendor.pygments.filtersr   Zpip._vendor.pygments.tokenr   r   r   r   r   Zpip._vendor.pygments.utilr   r	   r
   r   r   r   Zpip._vendor.pygments.regexoptr   Z__all__r   r   rE   ZstaticmethodZ_default_analyser!   r   r   r   rD   r   r^   r_   ra   r`   re   rv   rw   r   r   r   r   r   r   r   r   rX   r   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   