a
    ¥Q•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   úP/var/www/sistema_ama/venv/lib/python3.9/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   s\  |d u rt | ƒ}tj}tj}g }|j}d}d}d}	d}
d}|}|| |ƒ}|d u rT�qX| ¡ }||krh�qX| d¡}|t |ƒ }|d }|dv�r*||kr®|dd… }|d }n|d d… }|d }||	||d fƒ |d	v �rV|| |ƒ}|d u�rV| ¡ }||k�rV| d¡}|t |ƒ }||
||d fƒ q>|d
k�rF||||d fƒ q>||||d fƒ q>|S )NÚcommentÚstringÚkeywordÚ
identifierr   z#'"é   éÿÿÿÿ)r$   r   ú#)ÚlenÚmatchREÚsearchÚidREÚappendÚstartÚgroup)ZpytextZ
searchfromZsearchtor:   ZidSearchÚtagsZtags_appendZ
commentTagZ	stringTagZ
keywordTagZidentifierTagr=   ÚendÚmÚmatchÚcr   r   r	   Úfontifyd   sP    









rD   c                 C   sL   t | ƒ}| ¡ }| ¡  t|ƒ}|D ]"\}}}}t|t|||… ƒƒ q$d S r   )ÚopenÚreadÚcloserD   r#   Úrepr)ÚpathÚfÚtextr?   Útagr=   r@   Úsublistr   r   r	   Útest›   s    rN   )r   N)Ú__version__Ú__doc__Úrer
   ZkeywordsListZ
commentPatÚpatZquotePatr   r   ZtripleQuotePatZ	nonKeyPatZkeyPatZmatchPatÚcompiler9   ZidKeyPatr;   rD   rN   r   r   r   r	   Ú<module>   s&   


7