
    5h#/                        S r SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJrJr  SS	S
S.r/ SQ\" \5      -   \" \5      -   r0 r0 rS rS rSS jrS rS rS rSS jrSS jrSS jrS rSS jrS r S r! " S S\RD                  5      r#\RH                  \%   r&\#" \%5      r'\'RP                  RS                  \&RP                  5        \'\RH                  \%'   \'?'\'?&\'?\'?g)z
pygments.lexers
~~~~~~~~~~~~~~~

Pygments lexers.

:copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
    N)basename)LEXERS)get_filetype_from_buffer)find_plugin_lexers)ClassNotFoundguess_decodePythonLexerPythonTracebackLexer
Lean3Lexer)Python3LexerPython3TracebackLexer	LeanLexer)get_lexer_by_nameget_lexer_for_filenamefind_lexer_classguess_lexerload_lexer_from_filec                     U[         ;  aD  [        R                  " [        R                  " U5      5      =n[         U'   UR                  U 5      $ [         U   R                  U 5      $ )zBReturn whether the supplied file name fn matches pattern filename.)_pattern_cacherecompilefnmatch	translatematch)fnglobpatterns      c/var/www/html/cementerio_25MayoBackend/env/lib/python3.13/site-packages/pygments/lexers/__init__.py_fn_matchesr   #   sR    >!)+G4E4Ed4K)LL.&}}R  $%%b))    c                     [        U SSS/5      nUR                   H!  n[        X5      nU[        UR                  '   M#     g)z0Load a lexer (and all others in the module too).N__all__)
__import__r"   getattr_lexer_cachename)module_namemod
lexer_nameclss       r   _load_lexersr+   +   s:    
[$yk
:Ckk
c&!$SXX "r    c              #      #    [         R                  " 5        H
  nUSS v   M     U (       aB  [        5        H3  nUR                  UR                  UR
                  UR                  4v   M5     gg7f)zReturn a generator of tuples in the form ``(name, aliases,
filenames, mimetypes)`` of all know lexers.

If *plugins* is true (the default), plugin lexers supplied by entrypoints
are also returned.  Otherwise, only builtin ones are considered.
   N)r   valuesr   r&   aliases	filenames	mimetypes)pluginsitemlexers      r   get_all_lexersr5   3   sV      12h  ')E**emmU__eooMM * s   A.A0c                     U [         ;   a	  [         U    $ [        R                  " 5        H#  u  pn  nX:X  d  M  [        U5        [         U    s  $    [	        5        H  nUR
                  U :X  d  M  Us  $    g)z]
Return the `Lexer` subclass that with the *name* attribute as given by
the *name* argument.
N)r%   r   r.   r+   r   r&   )r&   r'   lnamer/   _r*   s         r   r   r   A   sh    
 |D!!-3]]_)GQ=%%% .=
 "#88tJ $r    c                 `   U (       d  [        SU < S35      e[        R                  " 5        H<  u  pn  nU R                  5       U;   d  M  U[        ;  a  [        U5        [        U   s  $    [        5        H%  nU R                  5       UR                  ;   d  M#  Us  $    [        SU < S35      e)a  
Return the `Lexer` subclass that has `alias` in its aliases list, without
instantiating it.

Like `get_lexer_by_name`, but does not instantiate the class.

Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
found.

.. versionadded:: 2.2
no lexer for alias  foundr   r   r.   lowerr%   r+   r   r/   )_aliasr'   r&   r/   r8   r*   s         r   find_lexer_class_by_namer?   S   s     1&6BCC,2MMO(7Aq<<>W$<'[)%%	 -< "#<<>S[[(J $ -fZv>
??r    c                 x   U (       d  [        SU < S35      e[        R                  " 5        HB  u  p#n  nU R                  5       U;   d  M  U[        ;  a  [        U5        [        U   " S0 UD6s  $    [        5        H+  nU R                  5       UR                  ;   d  M#  U" S0 UD6s  $    [        SU < S35      e)z
Return an instance of a `Lexer` subclass that has `alias` in its
aliases list. The lexer is given the `options` at its
instantiation.

Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is
found.
r:   r;    r<   )r>   optionsr'   r&   r/   r8   r*   s          r   r   r   n   s     1&6BCC -3MMO(7Aq<<>W$<'[)%000	 -< "#<<>S[[(>>! $ -fZv>
??r    c                 \    0 n[        U S5       n[        UR                  5       U5        SSS5        X;  a  [        SU SU  35      eX1   nU" S0 UD6$ ! , (       d  f       N0= f! [         a  n[        SU  SU 35      eSnAf[         a    e [
         a  n[        SU 35      eSnAff = f)	a  Load a lexer from a file.

This method expects a file located relative to the current working
directory, which contains a Lexer class. By default, it expects the
Lexer to be name CustomLexer; you can specify your own class name
as the second argument to this function.

Users should be very careful with the input, because this method
is equivalent to running eval on the input file.

Raises ClassNotFound if there are any problems importing the Lexer.

.. versionadded:: 2.2
rbNz	no valid z class found in zcannot read z: z!error when loading custom lexer: rA   )openexecreadr   OSError	Exception)filename	lexernamerB   custom_namespaceflexer_classerrs          r   r   r      s    G(D!Q+, " ,)I;6Fxj QRR&1%W%% "!  >l8*Bse<==  G?uEFFGs9   A& A)A& 
A#A& &
B+0BB+B&&B+c                   ^ / n[        U 5      n[        R                  " 5        HQ  u  pEpgnU HD  n[        X85      (       d  M  U[        ;  a  [        U5        UR                  [        U   U45        MF     MS     [        5        H:  n	U	R                   H'  n[        X85      (       d  M  UR                  X45        M)     M<     [        T[        5      (       a  [        T5      mU4S jn
U(       a  UR                  U
S9  US   S   $ g)zGet a lexer for a filename.

If multiple lexers match the filename pattern, use ``analyse_text()`` to
figure out which one is more appropriate.

Returns None if not found.
c                    > U u  pSU;  =(       a    S=(       d    SnT(       a   UR                  T5      U-   UR                  4$ UR                  U-   UR                  4$ )N*g      ?r   )analyse_text__name__priority)infor*   rJ   bonuscodes       r   
get_rating1find_lexer_class_for_filename.<locals>.get_rating   sZ    8#+0q
 ##D)E13<<??||e#S\\11r    keyr   N)r   r   r.   r   r%   r+   appendr   r0   
isinstancebytesr   sort)_fnrX   matchesr   modnamer&   r8   r0   rJ   r*   rY   s    `         r   find_lexer_class_for_filenamere      s     G	#B*0--/&qQ!H2((|+ )T 2H=>	 " +: "#H2((/ & $
 $D!
2 $r{1~ r    c                 V    [        X5      nU(       d  [        SU < S35      eU" S0 UD6$ )av  Get a lexer for a filename.

Return a `Lexer` subclass instance that has a filename pattern
matching `fn`. The lexer is given the `options` at its
instantiation.

Raise :exc:`pygments.util.ClassNotFound` if no lexer for that filename
is found.

If multiple lexers match the filename pattern, use their ``analyse_text()``
methods to figure out which one is more appropriate.
no lexer for filename r;   rA   )re   r   )rb   rX   rB   ress       r   r   r      s2     (
2C4SG6BCC>>r    c                    [         R                  " 5        H2  u  p#  pEX;   d  M  U[        ;  a  [        U5        [        U   " S0 UD6s  $    [	        5        H  nXR
                  ;   d  M  U" S0 UD6s  $    [        SU < S35      e)z
Return a `Lexer` subclass instance that has `mime` in its mimetype
list. The lexer is given the `options` at its instantiation.

Will raise :exc:`pygments.util.ClassNotFound` if not lexer for that mimetype
is found.
zno lexer for mimetype r;   rA   )r   r.   r%   r+   r   r1   r   )_mimerB   rd   r&   r8   r1   r*   s          r   get_lexer_for_mimetyperk      s     +1--/&q!<'W%%000	 +:
 "#MM!>>! $ 0	@
AAr    c              #      #    [        [        5       H1  n[        U   SS u  p#U[        ;  a  [        U5        [        U   v   M3     U (       a  [	        5        Sh  vN   gg N7f)z*Return an iterator over all lexer classes.N   )sortedr   r%   r+   r   )r2   r\   r'   r&   s       r   _iter_lexerclassesro      sY     f~"3KO|#%4  	 
 %''' 's   AA$A"A$c                 z  ^
 [        U 5      n0 m
[        5       n[        5        Hy  nUR                   H+  n[	        X65      (       d  M  UR                  U5        ST
U'   M-     UR                   H+  n[	        X65      (       d  M  UR                  U5        ST
U'   M-     M{     U(       d  [        SU< S35      e[        U5      S:X  a  UR                  5       " S
0 UD6$ / nU H6  nUR                  U5      nUS:X  a
  U" S
0 UD6s  $ UR                  X45        M8     U
4S jn	UR                  U	S9  US	   S   " S
0 UD6$ )z
As :func:`guess_lexer()`, but only lexers which have a pattern in `filenames`
or `alias_filenames` that matches `filename` are taken into consideration.

:exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
handle the content.
TFrg   r;   r-         ?c                 V   > U S   TU S      U S   R                   U S   R                  4$ Nr   r-   )rU   rT   )tprimarys    r   	type_sort+guess_lexer_for_filename.<locals>.type_sort$  s0     !gadmQqT]]AaDMMBBr    r[   r]   rA   )r   setro   r0   r   addalias_filenamesr   lenpoprS   r^   ra   )rb   _textrB   r   matching_lexersr4   rJ   resultrvrv   ru   s             @r   guess_lexer_for_filenamer     s7    
#BGeO#%H2((##E*!% ( --H2((##E*!& . & 4RF&ABB
?q ""$/w//F &9#7##rk"	 !C KKIK":a=#7##r    c                    [        U [        5      (       dP  UR                  SUR                  S5      5      nU(       a  U R                  U=(       d    S5      n O[	        U 5      u  p[        U 5      nUb   [        U40 UD6$ SS/n[        5        H4  nUR                  U 5      nUS:X  a
  U" S
0 UD6s  $ XuS   :  d  M.  Xv4USS& M6     US   (       a  US   c  [        S	5      eUS   " S
0 UD6$ ! [         a     Nxf = f)ag  
Return a `Lexer` subclass instance that's guessed from the text in
`text`. For that, the :meth:`.analyse_text()` method of every known lexer
class is called with the text as argument, and the lexer which returned the
highest value will be instantiated and returned.

:exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can
handle the content.

inencodingencodingutf8Ng        rq   r   r-   z no lexer matching the text foundrA   )
r_   strgetdecoder   r   r   r   ro   rS   )r}   rB   r   r8   ft
best_lexerr4   r   s           r   r   r   0  s    eS!![[w{{:/FG
LL!5v6E#E*HE 
"%	(B	~	$R3733 tJ#%&9#7##1KJqM & a=JqM1>??a=#7##  		s   5C- -
C:9C:c                       \ rS rSrSrS rSrg)_automoduleiW  zAutomatically import lexers.c                     [         R                  " U5      nU(       a(  [        US   5        [        US      n[	        XU5        U$ U[
        ;   a  [        U [
        U   5      $ [        U5      ers   )r   r   r+   r%   setattrCOMPATr$   AttributeError)selfr&   rV   r*   s       r   __getattr___automodule.__getattr__Z  s_    zz$a!tAw'CD$J6>4..T""r    rA   N)rT   
__module____qualname____firstlineno____doc__r   __static_attributes__rA   r    r   r   r   W  s
    &	#r    r   )T)CustomLexer)N)*r   r   systypesr   os.pathr   pygments.lexers._mappingr   pygments.modeliner   pygments.pluginr   pygments.utilr   r   r   listr"   r%   r   r   r+   r5   r   r?   r   r   re   r   rk   ro   r   r   
ModuleTyper   modulesrT   oldmodnewmod__dict__updaterA   r    r   <module>r      s   
 
    + 6 . 5 "3
248LACG<P *%N$@6@2GD(V&B&(($V$$N#%"" # 
X		X	   v 'H 
M6=&*flr    