
    )i%                     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   ﻿utf-8)s     zutf-32)s     zutf-32be)s   zutf-16)s   zutf-16bec                     g)N         )xs    N/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/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@   rC   r   
add_filter)selfrD   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 >)rD   	__class__r3   rG   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   rC   append)rG   rH   rD   s      r$   rF   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                 0   [        U[        5      (       d  U R                  S:X  a  [        U5      u  pGOU R                  S:X  a   SSKnSn[         H;  u  pgUR                  U5      (       d  M  U[        U5      S R                  US5      n  O   Uc>  UR                  USS 5      nUR                  UR                  S5      =(       d    S	S5      nUnOdU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.rA   chardetr   NzkTo enable chardet encoding guessing, please install the chardet library from http://chardet.feedparser.org/replacei   r@   r   u   ﻿z

)rR   strr@   r   rY   ImportError_encoding_map
startswithlendecodedetectrE   rZ   r=   stripr<   r?   
expandtabsr>   endswith)	rG   rV   _rY   edecodedbomr@   encs	            r$   _preprocess_lexer_inputLexer._preprocess_lexer_input   s    $$$}}'&t,a)+T" %2MCs++"&s3xy/"8"89"M &3
 ?!..et5C"kk#''**=*H*35G{{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   G: :
HHH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)rg   tvrG   rV   s      r$   streamer"Lexer.get_tokens.<locals>.streamer  s&     66t<ad
 =s   "%)rl   r   rC   )rG   rV   
unfilteredrt   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)rG   rV   s     r$   rq   Lexer.get_tokens_unprocessed  s
     "!r&   )r@   r>   rC   rD   r=   r<   r?   )F)r3   r4   r5   r6   r7   r/   aliases	filenamesalias_filenames	mimetypespriorityurlversion_added_examplerI   rO   rF   r+   rl   rx   rq   r8   r"   r&   r$   r   r   1   sl    8v D G
 I O I H C M H%<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   rI   )rG   _root_lexer_language_lexer_needlerD   s        r$   rI   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   rq   r   rS   ra   do_insertionsr   )rG   rV   buffered
insertions
lng_bufferirr   rs   s           r$   rq   &DelegatingLexer.get_tokens_unprocessed1  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)	r3   r4   r5   r6   r7   r   rI   rq   r8   r"   r&   r$   r   r   !  s     >C (Or&   r   c                       \ rS rSrSrSrg)r   iH  zA
Indicates that a state should include rules from another state.
r"   Nr3   r4   r5   r6   r7   r8   r"   r&   r$   r   r   H  s     	r&   r   c                       \ rS rSrSrS rSrg)_inheritiO  z;
Indicates the a state should inherit from its superclass.
c                     g)Nr   r"   rN   s    r$   rO   _inherit.__repr__S  s    r&   r"   N)r3   r4   r5   r6   r7   rO   r8   r"   r&   r$   r   r   O  s    r&   r   c                   $    \ rS rSrSrS rS rSrg)combinediY  z2
Indicates a state combined from multiple states.
c                 ,    [         R                  X5      $ rp   )tupler-   )clsargss     r$   r-   combined.__new__^  s    }}S''r&   c                     g rp   r"   )rG   r   s     r$   rI   combined.__init__a  s    r&   r"   N)r3   r4   r5   r6   r7   r-   rI   r8   r"   r&   r$   r   r   Y  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)_PseudoMatchif  z2
A pseudo match object constructed from a string.
c                     X l         Xl        g rp   )_text_start)rG   startrV   s      r$   rI   _PseudoMatch.__init__k  s    
r&   Nc                     U R                   $ rp   )r   rG   args     r$   r   _PseudoMatch.starto  s    {{r&   c                 F    U R                   [        U R                  5      -   $ rp   )r   ra   r   r   s     r$   end_PseudoMatch.endr  s    {{S_,,r&   c                 >    U(       a  [        S5      eU R                  $ )NzNo such group)
IndexErrorr   r   s     r$   group_PseudoMatch.groupu  s    _--zzr&   c                     U R                   4$ rp   )r   rN   s    r$   groups_PseudoMatch.groupsz  s    

}r&   c                     0 $ rp   r"   rN   s    r$   	groupdict_PseudoMatch.groupdict}  s    	r&   )r   r   rp   )r3   r4   r5   r6   r7   rI   r   r   r   r   r   r8   r"   r&   r$   r   r   f  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rp   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   )updaterD   rM   r   rq   r   r   r   )
r   r   r   lxsr   rr   rs   	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   rD   r   rq   r   r   r   )r   r   r   r   r   r   rr   rs   _otherr   r   s           r$   r   r     st     MM%--(!&!BA44U[[]PiPaeQk! Q))+ s   BBrp   )poprR   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 rp   r   )rG   r   s     r$   rI   default.__init__  s    
r&   r   N)r3   r4   r5   r6   r7   rI   r8   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 rp   )r   prefixsuffix)rG   r   r   r   s       r$   rI   words.__init__  s    
r&   c                 T    [        U R                  U R                  U R                  S9$ )Nr   r   )r   r   r   r   rN   s    r$   rE   	words.get  s    DKKLLr&   )r   r   r   N)r   r   )r3   r4   r5   r6   r7   rI   rE   r8   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.)rR   r   rE   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 )rR   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      )rR   r]   flagsr   r   r   r   r   r  r   rS   r   r   r   r,   r   r   	Exception
ValueErrorr   ra   )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_tokendefR  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__rE   itemsindexr   r  r   )
r   r  inheritablectoksr   r  curitemsinherit_ndxnew_inh_ndxs
             r$   get_tokendefsRegexLexerMeta.get_tokendefsZ  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"   rp   )r3   r4   r5   r6   r7   r   r   r  r   r  r#  r)  r8   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: r[   r   )r&  r   r,   r
   r   r   rR   r   ra   r   rS   r   absr	   r   r   )rG   rV   r   r   r  
statestackstatetokensrexmatchr   r   mr   s               r$   rq   !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   )r3   r4   r5   r6   r7   r   	MULTILINEr  r  rq   r8   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   )rV   r   ra   r   r   )rG   rV   r   r   r   s        r$   rI   LexerContext.__init__  s*    	##d)&vh
r&   c                 \    SU R                   < SU R                  < SU R                  < S3$ )NzLexerContext(z, ))rV   r   r   rN   s    r$   rO   LexerContext.__repr__  s)    tyym2dhh\DJJ>KKr&   )r   r   r   rV   NN)r3   r4   r5   r6   r7   rI   rO   r8   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.  r[   )r&  r   r   rV   r   r   r,   r
   r   rR   r   ra   r   rS   r   r/  r   r   r   )rG   rV   contextr  r   r1  r2  r   r   r3  r   s              r$   rq   )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=  )r3   r4   r5   r6   r7   rq   r8   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StopIterationra   )r   r  r  r  realposinsleftr   rr   rs   olditmpvalit_indexit_tokenit_valueps                  r$   r   r   Q  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   )rV   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&   )	rR   r   r   r   r   r   r   sysmaxsize)r   r   r   r   r[  rZ  r  s   `  ` @@r$   r   &ProfilingRegexLexerMeta._process_regex  s]    eU##EKK#(<<1C C::c6*), 	 	 r&   r"   N)r3   r4   r5   r6   r7   r   r8   r"   r&   r$   rO  rO    s
    Hr&   rO  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  )reprrd   rZ   ).0r   rnrr   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                      $ rp   )_prof_sort_index)r#   rG   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"   )rh  r#   s     r$   rk  rl    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)rM   rR  rS   r   rq   r   sortedr  sumprintr3   ra   )rG   rV   r   rawdatar   	sum_totalr1   s   `      r$   rq   *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"   Nr5  )	r3   r4   r5   r6   r7   rR  rn  rq   r8   r"   r&   r$   ra  ra    s    PJr&   ra  )6r7   r   r]  rT  pygments.filterr   r   pygments.filtersr   pygments.tokenr   r   r   r	   r
   pygments.utilr   r   r   r   r   r   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   rO  ra  r"   r&   r$   <module>r     sJ   
 
  1 / E E* * '* **W
,  . 	1 	1m"i m"`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&   