§
    0›jV  ã                  ó¸   — d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZ ddlmZ ddlmZmZ ee	j                 Zdd
„Zdd„Zdd„Zdd„Zdd„ZdS )z"Better tokenizing for coverage.py.é    )ÚannotationsN)ÚIterable)Úenv)ÚTLineNoÚTSourceTokenLinesÚtoksÚ
TokenInfosÚreturnc           	   #  ó®  K  — d}d}d}| D �]H\  }}\  }}\  }}	}
||k    r÷|ró|                      d¦  «        rÞd}|                      d¦  «        rd}nv|t          j        k    rC|                      d¦  «        r+|                     d¦  «                              |¦  «        rd}n&d}n#t          j        j        r|t          j        k    rd}|rLt          | 	                    d	¦  «        d
         ¦  «        dz
  }t          j        dd||f||dz   f|¦  «        V — |
}|t          j        t          j        fvr|}t          j        ||||f||	f|
¦  «        V — |}�ŒJdS )aB  Return all physical tokens, even line continuations.

    tokenize.generate_tokens() doesn't return a token for the backslash that
    continues lines.  This wrapper provides those tokens so that we can
    re-create a faithful representation of the original source.

    Returns the same values as generate_tokens()

    NéÿÿÿÿÚ z\
Tú\Fz \
ú
éþÿÿÿé   iŸ† é   )ÚendswithÚtokenÚSTRINGÚrstripr   Ú
PYBEHAVIORÚfstring_syntaxÚFSTRING_MIDDLEÚlenÚsplitÚtokenizeÚ	TokenInfoÚNEWLINEÚNL)r   Ú	last_lineÚlast_linenoÚ
last_ttextÚttypeÚttextÚslinenoÚscolÚelinenoÚecolÚltextÚinject_backslashÚccols                úR/home/lighthouse/health/venv/lib64/python3.11/site-packages/coverage/phystokens.pyÚ_phys_tokensr-      sÆ  è è € ð !€IØ€KØ€JØAEð 6ñ 6Ñ=ˆˆu‘o�w ¡¨°¸Ø˜'Ò!Ð!Øð /˜Y×/Ò/°Ñ7Ô7ð /ð  $(Ð Ø×&Ò& tÑ,Ô,ð -Ø',Ð$Ð$Ø�eœlÒ*Ð*à!×*Ò*¨6Ñ2Ô2ð1à%×,Ò,¨WÑ5Ô5×>Ò>¸zÑJÔJð1ð ,0Ð(Ð(ð ,1Ð(Ð(Ý”^Ô2ð -°uÅÔ@TÒ7TÐ7TØ',Ð$Ø#ð 
å˜yŸš¨tÑ4Ô4°RÔ8Ñ9Ô9¸AÑ=�Då"Ô,ØØØ  $˜Ø  $¨¡(Ð+Ø!ñô ð ð ð ð ˆIØ�Ô)­8¬;Ð7Ð7Ð7ØˆJÝÔ  ¨°¸¨ÀÈ$ÀÐQVÑWÔWÐWÐWÐWØˆ‰ðm6ð 6ó    ÚsourceÚstrúset[TLineNo]c                óh  — t          ¦   «         }t          j        t          j        | ¦  «        ¦  «        D ]ü}t	          |t          j        ¦  «        rD|                     |j        ¦  «         |j        D ]!}|                     |j	        j        ¦  «         Œ"Œ`t          j        dk    r5t	          |t          j        ¦  «        r|                     |j        ¦  «         Œ¥t          j        dk    rGt	          |t          j        t          j        f¦  «        r!|j        r|                     |j        ¦  «         Œý|S )zCHelper for finding lines with soft keywords, like match/case lines.)é   é   )r3   é   )ÚsetÚastÚwalkÚparseÚ
isinstanceÚMatchÚaddÚlinenoÚcasesÚpatternÚsysÚversion_infoÚ	TypeAliasÚImportÚ
ImportFromÚis_lazy)r/   Úsoft_key_linesÚnodeÚcases       r,   Úfind_soft_key_linesrI   ]   s  € å#&¡5¤5€Nå”�œ 6Ñ*Ô*Ñ+Ô+ð 0ð 0ˆõ �d�CœIÑ&Ô&ð 	0Ø×Ò˜tœ{Ñ+Ô+Ð+Øœ
ð 8ð 8�Ø×"Ò" 4¤<Ô#6Ñ7Ô7Ð7Ð7ð8åÔ Ò(Ð(­Z¸½c¼mÑ-LÔ-LÐ(Ø×Ò˜tœ{Ñ+Ô+Ð+Ð+ÝÔ Ò(Ð(­Z¸½s¼zÍ3Ì>Ð>ZÑ-[Ô-[Ð(ØŒ|ð 0Ø×"Ò" 4¤;Ñ/Ô/Ð/øàÐr.   r   c              #  óŒ  K  — t           j        t           j        t           j        t          j        h}g }d}|                      d¦  «                             dd¦  «        } t          | ¦  «        }t          | ¦  «        }t          |¦  «        D �]¯\  }}\  }}	\  }
}}
d}t          j        d|¦  «        D �]ƒ}|dk    r|V — g }d}d}�nl|dk    rd}�nb||v rd}�nZt          j        j        rL|t           j        k    r<|                     d	d
¦  «                             dd¦  «        }|	t#          |¦  «        z   }|r%|	|k    r|                     dd|	|z
  z  f¦  «         d}t          j                             |d¦  «                             ¦   «         dd…         }|t           j        k    rst/          j        |¦  «        rd}n\t/          j        |¦  «        rHt#          |¦  «        dk    rd}n*t#          |¦  «        dk    r|d         d         dk    rd}nd}|r||v rd}|                     ||f¦  «         d}d}	�Œ…|r|}�Œ±|r|V — dS dS )a  Generate a series of lines, one for each line in `source`.

    Each line is a list of pairs, each pair is a token::

        [('key', 'def'), ('ws', ' '), ('nam', 'hello'), ('op', '('), ... ]

    Each pair has a token class, and the token text.

    If you concatenate all the token texts, and then join them with newlines,
    you should have your original `source` back, with two differences:
    trailing white space is not preserved, and a final line with no newline
    is indistinguishable from a final line with a newline.

    r   é   z
r   Tz(
)Fr   Ú{z{{Ú}z}}Úwsú ÚxxNr3   Úkeyr   )r   ÚINDENTÚDEDENTr   r   r   Ú
expandtabsÚreplaceÚgenerate_tokensrI   r-   Úrer   r   r   r   r   r   ÚappendÚtok_nameÚgetÚlowerÚNAMEÚkeywordÚ	iskeywordÚissoftkeyword)r/   Ú	ws_tokensÚlineÚcolÚtokgenrF   r#   r$   Úsliner&   Ú_r(   Ú
mark_startÚpartÚmark_endÚ	tok_classÚis_start_of_lines                    r,   Úsource_token_linesrk   q   sŒ  è è € õ  ”�uœ|­U¬]½H¼KÐH€IØ"$€DØ
€Cà×Ò˜qÑ!Ô!×)Ò)¨&°$Ñ7Ô7€FÝ˜VÑ$Ô$€Få(¨Ñ0Ô0€Nå5AÀ&Ñ5IÔ5Ið &ñ &Ñ1ˆˆu‘m�u˜d¡Y a¨°Øˆ
Ý”H˜V UÑ+Ô+ð "	ñ "	ˆDØ�tŠ|ˆ|Ø�
�
�
Ø�Ø�Ø �‘Ø˜’�Ø �‘Ø˜)Ð#Ð#Ø �‘å”>Ô0ð ,°U½eÔ>RÒ5RÐ5RØŸ<š<¨¨TÑ2Ô2×:Ò:¸3ÀÑEÔE�DØ¥# d¡)¤)Ñ+�DØð ' $¨¢* *Ø—K’K  s¨d°S©jÑ'9Ð :Ñ;Ô;Ð;Ø!&�JÝ$Ô-×1Ò1°%¸Ñ>Ô>×DÒDÑFÔFÀrÈÀrÔJ�	Ø�EœJÒ&Ð&ÝÔ(¨Ñ/Ô/ð .à$)˜	˜	Ý Ô.¨uÑ5Ô5ð 	.å˜t™9œ9¨š>˜>Ø/3Ð,Ð,Ý! $™iœi¨1šn˜n°$°q´'¸!´*ÀÒ2DÐ2DØ/3Ð,Ð,à/4Ð,Ø+ð .°¸Ð0GÐ0GØ(-˜IØ—’˜Y¨Ð-Ñ.Ô.Ð.Ø�ØˆD‰DØð 	ØˆCùàð Øˆ
ˆ
ˆ
ˆ
ˆ
ðð r.   Útextc                ó\   — t          j        | ¦  «        j        }t          j        |¦  «        S )zÇA helper around `tokenize.generate_tokens`.

    Originally this was used to cache the results, but it didn't seem to make
    reporting go faster, and caused issues with using too much memory.

    )ÚioÚStringIOÚreadliner   rV   )rl   rp   s     r,   rV   rV   ¶   s'   € õ Œ{˜4Ñ Ô Ô)€HÝÔ# HÑ-Ô-Ð-r.   Úbytesc                ó„   — t          |                      d¦  «        ¦  «        j        }t          j        |¦  «        d         S )zªDetermine the encoding for `source`, according to PEP 263.

    `source` is a byte string: the text of the program.

    Returns a string, the name of the encoding.

    Tr   )ÚiterÚ
splitlinesÚ__next__r   Údetect_encoding)r/   rp   s     r,   Úsource_encodingrw   Á   s8   € õ �F×%Ò% dÑ+Ô+Ñ,Ô,Ô5€HÝÔ# HÑ-Ô-¨aÔ0Ð0r.   )r   r	   r
   r	   )r/   r0   r
   r1   )r/   r0   r
   r   )rl   r0   r
   r	   )r/   rq   r
   r0   )Ú__doc__Ú
__future__r   r7   rn   r]   rW   r@   r   r   Úcollections.abcr   Úcoverager   Úcoverage.typesr   r   r   r	   r-   rI   rk   rV   rw   © r.   r,   ú<module>r~      s  ðð )Ð (à "Ð "Ð "Ð "Ð "Ð "à 
€
€
€
Ø 	€	€	€	Ø €€€Ø 	€	€	€	Ø 
€
€
€
Ø €€€Ø €€€Ø $Ð $Ð $Ð $Ð $Ð $à Ð Ð Ð Ð Ð Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5à�hÔ(Ô)€
ðCð Cð Cð CðLð ð ð ð(Bð Bð Bð BðJ.ð .ð .ð .ð	1ð 	1ð 	1ð 	1ð 	1ð 	1r.   