o
    êÁhl  ã                   @   sÞ   d Z dZdZ ddlZdd„ Zg d¢ZdZd	Zeed
dƒd eed
dƒ ZdZd e 	¡ ¡Zeed
dƒd eed
dƒ Z
dZed d e¡ d e Zed e d e
 d e Ze e¡ZdZe e¡Zddd„Zdd„ ZdS )z3.3.0a|  
Module to analyze Python source code; for syntax coloring tools.

Interface::

    tags = fontify(pytext, searchfrom, searchto)

 - The 'pytext' argument is a string containing Python source code.
 - The (optional) arguments 'searchfrom' and 'searchto' may contain a slice in pytext.
 - The returned value is a list of tuples, formatted like this::
    [('keyword', 0, 6, None), ('keyword', 11, 17, None), ('comment', 23, 53, None), etc. ]

 - The tuple contents are always like this::
    (tag, startindex, endindex, sublist)

 - tag is one of 'keyword', 'string', 'comment' or 'identifier'
 - sublist is not used, hence always None.
z0.4é    Nc                 C   s   |  |  |¡¡S ©N)ÚjoinÚsplit)ÚsrcÚsepÚrep© r   úN/var/www/html/pos/venv/lib/python3.10/site-packages/reportlab/lib/PyFontify.pyÚreplace(   s   r
   )ÚasÚassertÚexecÚdelÚfromÚlambdaÚreturnÚandÚelifÚglobalÚnotÚtryÚbreakÚelseÚifÚorÚwhileÚclassÚexceptÚimportÚpassÚcontinueÚfinallyÚinÚprintÚdefÚforÚisÚraiseÚyieldÚwithz#[^\n]*z$q[^\\q\n]*(\\[\000-\377][^\\q\n]*)*qÚqú'ú|ú"a  
    qqq
    [^\\q]*
    (
        (   \\[\000-\377]
        |   q
            (   \\[\000-\377]
            |   [^\q]
            |   q
                (   \\[\000-\377]
                |   [^\\q]
                )
            )
        )
        [^\\q]*
    )*
    qqq
Ú z(^|[^a-zA-Z0-9_.\"'])ú(ú)z[ 	]*[A-Za-z_][A-Za-z_0-9.]*c                 C   sT  |d u rt | ƒ}tj}tj}g }|j}d}d}d}	d}
d}|}	 || |ƒ}|d u r,	 |S | ¡ }||kr7	 |S | d¡}|t |ƒ }|d }|dvr”||krY|dd… }|d }n|d d… }|d }||	||d fƒ |d	v r“|| |ƒ}|d ur“| ¡ }||kr“| d¡}|t |ƒ }||
||d fƒ n|d
kr¡||||d fƒ n||||d fƒ q )NÚcommentÚstringÚkeywordÚ
identifierr   é   z#'"éÿÿÿÿ)r$   r   ú#)ÚlenÚmatchREÚsearchÚidREÚappendÚstartÚgroup)ÚpytextÚ
searchfromÚsearchtor:   ÚidSearchÚtagsÚtags_appendÚ
commentTagÚ	stringTagÚ
keywordTagÚidentifierTagr=   ÚendÚmÚmatchÚcr   r   r	   Úfontifyd   sX   
!à
ã


€ÝrM   c                 C   sL   t | ƒ}| ¡ }| ¡  t|ƒ}|D ]\}}}}t|t|||… ƒƒ qd S r   )ÚopenÚreadÚcloserM   r#   Úrepr)ÚpathÚfÚtextrC   Útagr=   rI   Úsublistr   r   r	   Útest›   s   ÿrW   )r   N)Ú__version__Ú__doc__Úrer
   ÚkeywordsListÚ
commentPatÚpatÚquotePatr   r   ÚtripleQuotePatÚ	nonKeyPatÚkeyPatÚmatchPatÚcompiler9   ÚidKeyPatr;   rM   rW   r   r   r   r	   Ú<module>   s(   


7