Ë
    ìÏj£¾  ã                  ó>  — 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	m
Z
mZmZ ddlmZ ddlmZmZ ddlmZ ddlmZ dd	lmZ dd
lmZmZ ddlmZmZ ddlmZ ddl m!Z!m"Z"  ee«      Zd%d„Z#d&d„Z$ G d„ d«      Z% edd¬«       G d„ d«      «       Z& G d„ de«      Z'e(e!e)e*e+dz  e+dz  f      f   Z, G d„ d«      Z- G d„ de-«      Z. G d„ de-«      Z/ G d„ de-«      Z0ejb                  ejd                  ejf                  fZ4d'd „Z5d(d!„Z6d)d"„Z7 G d#„ d$«      Z8y)*zCode parsing for coverage.py.é    )ÚannotationsN)ÚCallableÚIterableÚSequence)Ú	dataclass)ÚProtocolÚcast)Úenv)Ú
ByteParser)Úshort_stack)ÚNoSourceÚ	NotPython)Úisolate_moduleÚ	nice_pair)Úgenerate_tokens)ÚTArcÚTLineNoc                óò   — i }d}| D ]m  \  }}\  }}\  }}}|t         j                  k(  r"|r||k7  rt        ||dz   «      D ]  }|||<   Œ	 d}|j                  «       sŒU|t        j
                  k7  sŒi|rŒl|}Œo |S )a˜  Compute the multiline map from a stream of tokens.

    The result maps line numbers in multi-line statements to the first line
    number of their statement.  This is the only place the map is computed:
    `PythonParser._raw_parse` uses it for parsing and reporting, and the
    sys.monitoring core uses `multiline_map_from_text` to get the map without
    paying for a full parse during measurement.

    r   é   )ÚtokenÚNEWLINEÚrangeÚstripÚtokenizeÚCOMMENT)	ÚtokensÚmultiline_mapÚ
first_lineÚtoktypeÚttextÚslinenoÚ_ÚelinenoÚlinenos	            úL/var/www/html/gaurav-v2/venv/lib/python3.12/site-packages/coverage/parser.pyÚmultiline_map_from_tokensr&      sŽ   € ð -/€Mà€JÛ9?Ñ5ˆ�™˜ !¡l w°°AØ”e—m‘mÒ#Ù˜g¨Ò3ô $ J°¸!±Ö<�FØ,6�M &Ò)ð =àˆJØ�;‰;�=˜W¬×(8Ñ(8Ó8âØ$‘
ð :@ð Ðó    c                ó*   — t        t        | «      «      S )zµCompute just the multiline map for `text`, without a full parse.

    Can raise tokenize.TokenError, IndentationError, or SyntaxError if the
    text isn't parsable as Python.

    )r&   r   )Útexts    r%   Úmultiline_map_from_textr*   :   s   € ô %¤_°TÓ%:Ó;Ð;r'   c                  óž   — e Zd ZdZ	 	 	 d	 	 	 	 	 	 	 dd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	dd	„Z
dd
„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zy)ÚPythonParserz™Parse code to find executable lines, excluded lines, etc.

    This information is all based on static analysis: no code execution is
    involved.

    Nc                óî  — |s	|sJ d«       ‚|xs d| _         |�|| _        nddlm} 	  || j                   «      | _        || _        d| _        t        «       | _	        t        «       | _
        t        «       | _        t        «       | _        t        «       | _        d| _        i | _        d| _        d| _        i | _        i | _        d| _        y# t        $ r!}t        d| j                   › d|› �«      |‚d}~ww xY w)	zÆ
        Source can be provided as `text`, the text itself, or `filename`, from
        which the text will be read.  Excluded lines are those that match
        `exclude`, a regex string.

        z*PythonParser needs either text or filenamez<code>Nr   )Úget_python_sourcezNo source for code: 'z': F)Úfilenamer)   Úcoverage.pythonr.   ÚOSErrorr   ÚexcludeÚ	_ast_rootÚsetÚ
statementsÚexcludedÚraw_statementsÚraw_excludedÚraw_docstringsÚshow_tokensr   Ú	_all_arcsÚ_missing_arc_fragmentsÚ_with_jump_fixersÚ_first_line_cacheÚ_exit_counts)Úselfr)   r/   r2   r.   Úerrs         r%   Ú__init__zPythonParser.__init__L   s  € ñ ‘xÐMÐ!MÓMÐØ Ò, HˆŒØÐØ!ˆD�Iå9ðYÙ-¨d¯m©mÓ<�”	ð ˆŒð *.ˆŒô
 ),«ˆŒô '*£eˆŒô -0«EˆÔô +.«%ˆÔô -0«EˆÔð !ˆÔð 68ˆÔð ,0ˆŒØ<@ˆÔ#Ø@BˆÔà9;ˆÔØ7;ˆÕøôW ò YÜÐ!6°t·}±}°oÀSÈÈÐNÓOÐUXÐXûðYús   ¨C
 Ã
	C4ÃC/Ã/C4c           	     ó�  ‡ — t        «       }d}d}t        j                  |‰ j                  t        j                  ¬«      D ]ƒ  }|j                  «       \  }}|‰ j                  j                  d||«      z   }|‰ j                  j                  d||«      z   }	|j                  ˆ fd„t        |dz   |	dz   «      D «       «       |}|}Œ… |S )zâFind the lines matching a regex.

        Returns a set of line numbers, the lines that contain a match for
        `regex`. The entire line needn't match, just a part of it.
        Handles multiline regex patterns.

        r   )ÚflagsÚ
c              3  óV   •K  — | ]   }‰j                   j                  ||«      –— Œ" y ­w©N)r   Úget)Ú.0Úir@   s     €r%   Ú	<genexpr>z.PythonParser.lines_matching.<locals>.<genexpr>ž   s)   øè ø€ ð Ù6Y°�×"Ñ"×&Ñ& q¨!×,Ñ6Yùs   ƒ&)r   é   )	r4   ÚreÚfinditerr)   Ú	MULTILINEÚspanÚcountÚupdater   )
r@   ÚregexÚmatchesÚ
last_startÚlast_start_lineÚmatchÚstartÚendÚ
start_lineÚend_lines
   `         r%   Úlines_matchingzPythonParser.lines_matchingŽ   s·   ø€ ô !$£ˆàˆ
ØˆÜ—[‘[ ¨¯	©	¼¿¹×FˆEØŸ™›‰JˆE�3Ø(¨4¯9©9¯?©?¸4ÀÈUÓ+SÑSˆJØ&¨¯©¯©¸¸zÈ3Ó)OÑOˆHØ�N‰Nó Ü6;¸JÈ¹NÈHÐWXÉLÔ6Yóô ð ˆJØ(‰Oð Gð ˆr'   c           
     óî
  — | j                   r:| j                  | j                   «      | _        t        | j                  «      | _        d}d}d}d}d}d}| j
                  €J ‚t        t        | j
                  «      «      }t        |«      | _	        |D �]x  \  }}	\  }
}\  }}}| j                  rBt        t        j                  j                  ||«      d›dt        |
|f«      d›d|	d›d|›�«       |t         j"                  k(  r|d	z  }n«|t         j$                  k(  r|d	z  }n’|t         j&                  k(  rj|	d
k(  rQ|dk(  rL| j                  j)                  t+        ||d	z   «      «      }|sK|rI| j                  j-                  |«       |}d}n)|	dv r|d	z  }n|	dv r|d	z  }n|t         j.                  k(  rd}|	j1                  «       s�Œ4|t        j2                  k7  s�ŒId}|r�ŒO|
}|r||k  rd}|s�Œ^| j                  j-                  |«       �Œ{ |sJt5        | j
                  | j6                  ¬«      }| j8                  j;                  |j=                  «       «       | j?                  | j                  «      | _        | j@                  €J ‚tC        | j@                  «      D �]Ö  }tE        |tF        jH                  tF        jJ                  tF        jL                  tF        jN                  f«      rÇ|jP                  r»|jP                  d   }tE        |tF        jR                  «      r’tE        |jT                  tF        jV                  «      rntE        |jT                  jT                  tX        «      rJ| jZ                  j;                  t+        |j\                  t_        t`        |jb                  «      d	z   «      «       tE        |tF        jH                  tF        jJ                  tF        jL                  f«      ršte        d„ |jf                  D «       |j\                  ¬«      }| j                  j)                  t+        ||j\                  d	z   «      «      r@| j                  j;                  t+        |t_        t`        |jb                  «      d	z   «      «       tE        |tF        jh                  «      s�Œtk        |«      s�Œt+        |jP                  d   j\                  t_        t`        |jP                  d   jb                  «      d	z   «      }| j8                  t        |«      z  }|s�Œv|| j                  k  s�Œ‡| j                  j;                  t+        |jl                  j\                  |jl                  jb                  d	z   «      «       �ŒÙ y)zwParse the source to find the interesting facts about its lines.

        A handful of attributes are updated.

        r   FTNz>10Ú z>5Ú20r   Ú:z([{z)]})r)   r/   c              3  ó4   K  — | ]  }|j                   –— Œ y ­wrG   ©r$   )rI   Úds     r%   rK   z*PythonParser._raw_parse.<locals>.<genexpr>	  s   è ø€ Ð!HÑ4G¨q !§(¥(Ñ4Gùs   ‚)Údefaultéÿÿÿÿ)7r2   r\   r8   r4   r6   r)   Úlistr   r&   r   r:   Úprintr   Útok_namerH   r   r   ÚINDENTÚDEDENTÚOPÚintersectionr   Úaddr   r   r   r   r/   r7   rR   Úfind_statementsÚfirst_linesr3   Úwalk_statement_nodesÚ
isinstanceÚastÚClassDefÚFunctionDefÚAsyncFunctionDefÚModuleÚbodyÚExprÚvalueÚConstantÚstrr9   r$   r	   ÚintÚ
end_linenoÚminÚdecorator_listÚ
match_caseÚ_case_is_irrefutableÚpattern)r@   ÚindentÚexclude_indentÚ	excludingr   ÚemptyÚnestingr   r   r    r!   r"   r#   ÚltextÚshould_excludeÚbyte_parserÚnodeÚfirstÚ
body_linesÚbody_statementss                       r%   Ú
_raw_parsezPythonParser._raw_parse¥   s,  € ð �<Š<Ø $× 3Ñ 3°D·L±LÓ AˆDÔÜ × 1Ñ 1Ó2ˆDŒMð ˆàˆàˆ	àˆ
àˆàˆà�y‰yÐ$Ð$Ð$Ü”o d§i¡iÓ0Ó1ˆÜ6°vÓ>ˆÔÜAGÑ=ˆG�U™L˜W a©,¨7°A¸Ø×ÒÜô !×)Ñ)×-Ñ-¨g°wÖ?Ü! 7¨GÐ"4Ö5ÛÙðôð œ%Ÿ,™,Ò&Ø˜!‘‘ØœEŸL™LÒ(Ø˜!‘‘ØœEŸH™HÒ$Ø˜C’< G¨q¢LØ%)§]¡]×%?Ñ%?ÄÀjÐRYÐ\]ÑR]Ó@^Ó%_�NÙ$©ð Ÿ™×)Ñ)¨'Ô2Ø)/˜Ø$(™	Ø˜e‘^Ø˜q‘L‘GØ˜e‘^Ø˜q‘L‘GØœEŸM™MÒ)ð �
à�{‰{Ž} ¬H×,<Ñ,<Ô!<à�Û!à!(�Já  V¨~Ò%=Ø$)˜	Û ØŸ™×)Ñ)¨'Ö2ð[ BHñ` Ü$¨$¯)©)¸d¿m¹mÔLˆKØ×Ñ×&Ñ& {×'BÑ'BÓ'DÔEà×(Ñ(¨¯©Ó7ˆŒð �~‰~Ð)Ð)Ð)Ü(¨¯©×8ˆDä˜$¤§¡¬s¯©Ä×@TÑ@TÔVY×V`ÑV`Ð aÔbØ—9’9Ø ŸI™I a™L�Eä" 5¬#¯(©(Ô3Ü& u§{¡{´C·L±LÔAÜ& u§{¡{×'8Ñ'8¼#Ô>à×+Ñ+×2Ñ2Ü! %§,¡,´´S¸%×:JÑ:JÓ0KÈaÑ0OÓPôô
 ˜$¤§¡¬s¯©Ä×@TÑ@TÐ UÔVÜ Ñ!H°D×4GÒ4GÓ!HÐRV×R]ÑR]Ô^�
Ø—=‘=×-Ñ-¬e°JÀÇÁÈaÁÓ.PÔQØ—M‘M×(Ñ(¬¨z¼4ÄÀTÇ_Á_Ó;UÐXYÑ;YÓ)ZÔ[ô ˜$¤§¡Ö/Ô4HÈÖ4NÜ" 4§9¡9¨Q¡<×#6Ñ#6¼¼SÀ$Ç)Á)ÈBÁ-×BZÑBZÓ8[Ð^_Ñ8_Ó`�
Ø"&×"5Ñ"5¼¸J»Ñ"G�Û" ¸$¿-¹-Ô'GØ—M‘M×(Ñ(¬¨t¯|©|×/BÑ/BÀDÇLÁL×D[ÑD[Ð^_ÑD_Ó)`Öañ9 9r'   c                óà   — | j                   j                  |«      }|€P|dk  r | j                  j                  | | «       }n| j                  j                  ||«      }|| j                   |<   |S )zAReturn the first line number of the statement including `lineno`.r   )r>   rH   r   )r@   r$   rŒ   s      r%   r   zPythonParser.first_line  sp   € à×&Ñ&×*Ñ*¨6Ó2ˆØˆ=Ø˜ŠzØ×+Ñ+×/Ñ/°°¸&¸ÓAÐA‘à×*Ñ*×.Ñ.¨v°vÓ>�Ø-2ˆD×"Ñ" 6Ñ*Øˆr'   c                óJ   — |D �ch c]  }| j                  |«      ’Œ c}S c c}w )zŠMap the line numbers in `linenos` to the correct first line of the
        statement.

        Returns a set of the first lines.

        )r   )r@   Úlinenosr$   s      r%   ro   zPythonParser.first_lines"  s%   € ñ 7>Ó>±g¨F�—‘ Õ'°gÑ>Ð>ùÒ>s   … c                ó$   — | j                  |«      S )z)Implement `FileReporter.translate_lines`.)ro   )r@   Úliness     r%   Útranslate_lineszPythonParser.translate_lines+  s   € à×Ñ Ó&Ð&r'   c                ó–   — | j                  |«      D ��ch c]'  \  }}| j                  |«      | j                  |«      f’Œ) c}}S c c}}w )z(Implement `FileReporter.translate_arcs`.)Úfix_with_jumpsr   )r@   ÚarcsÚaÚbs       r%   Útranslate_arcszPythonParser.translate_arcs/  sC   € àGK×GZÑGZÐ[_ÔG`ÔaÑG`¹V¸aÀ�—‘ Ó# T§_¡_°QÓ%7Ò8ÐG`ÒaÐaùÓas   •,Ac                óð  — 	 t        j                  | j                  «      | _        | j	                  «        | j                  | j                  z  }| j                   |z
  }| j#                  |«      |z
  | _        y# t
        j                  t        t        f$ r_}t        |d«      r|j                  }n|j                  d   d   }t        d| j                  › d�|j                  d   ›d|› �z   «      |‚d}~ww xY w)zÁParse source text to find executable lines, excluded lines, etc.

        Sets the .excluded and .statements attributes, normalized to the first
        line of multi-line statements.

        r$   r   r   zCouldn't parse 'z' as Python source: z	 at line N)rr   Úparser)   r3   r�   r   Ú
TokenErrorÚIndentationErrorÚSyntaxErrorÚhasattrr$   Úargsr   r/   r6   r9   r7   ro   r5   )r@   rA   r$   ÚignoreÚstartss        r%   Úparse_sourcezPythonParser.parse_source3  sä   € ð	Ü ŸY™Y t§y¡yÓ1ˆDŒNØ�O‰OÔð —‘ ×!4Ñ!4Ñ4ˆØ×$Ñ$ vÑ-ˆØ×*Ñ*¨6Ó2°VÑ;ˆ�øô ×#Ñ#Ô%5´{ÐCò 	Ü�s˜HÔ%ØŸ™‘àŸ™ !™ Q™�ÜØ" 4§=¡= /Ð1EÐFØ—X‘X˜a‘[�O 9¨V¨HÐ5ñ6óð ðûð	ús   ‚4A8 Á8C5ÂAC0Ã0C5c                ón   — | j                   €| j                  «        | j                   €J ‚| j                   S )zÃGet information about the arcs available in the code.

        Returns a set of line number pairs.  Line numbers have been normalized
        to the first line of multi-line statements.

        )r;   Ú_analyze_ast©r@   s    r%   r˜   zPythonParser.arcsK  s4   € ð �>‰>Ð!Ø×ÑÔØ�~‰~Ð)Ð)Ð)Ø�~‰~Ðr'   c                ó  — | j                   €J ‚t        | j                  | j                   | j                  | j                  «      }|j                  «        |j                  }|j                  «       | _        | j                  r| j                  |«      }t        «       | _        |D ]J  \  }}| j                  |«      }| j                  |«      }||k7  sŒ.| j                  j                  ||f«       ŒL |j                  | _        d| _         y)zkRun the AstArcAnalyzer and save its results.

        `_all_arcs` is the set of arcs in the code.

        N)r3   ÚAstArcAnalyzerr/   r7   r   Úanalyzer˜   Úwith_jump_fixersr=   r—   r4   r;   r   rm   Úmissing_arc_fragmentsr<   )r@   Úaaar˜   Úl1Úl2Úfl1Úfl2s          r%   r§   zPythonParser._analyze_astW  sÞ   € ð �~‰~Ð)Ð)Ð)Ü˜TŸ]™]¨D¯N©N¸D×<OÑ<OÐQU×QcÑQcÓdˆØ�‰ŒØ�x‰xˆØ!$×!5Ñ!5Ó!7ˆÔØ×!Ò!Ø×&Ñ& tÓ,ˆDä›ˆŒÛ‰FˆB�Ø—/‘/ "Ó%ˆCØ—/‘/ "Ó%ˆCØ�c‹zØ—‘×"Ñ" C¨ :Õ.ð	 ð '*×&?Ñ&?ˆÔ#ð ˆ�r'   c                ó¼  — t        «       }t        «       }|D ]±  }|| j                  v sŒ|d   }|j                  |«       | j                  |   \  }}|| j                  v rC|j                  |«       | j                  |   \  }}|j                  |«       || j                  v rŒC|j                  ||d   f«       |j                  |«       Œ³ t        |«      |z  |z
  }|S )a•  Adjust arcs to fix jumps leaving `with` statements.

        Consider this code:

            with open("/tmp/test", "w") as f1:
                a = 2
                b = 3
            print(4)

        In 3.10+, we get traces for lines 1, 2, 3, 1, 4.  But we want to present
        it to the user as if it had been 1, 2, 3, 4.  The arc 3->1 should be
        replaced with 3->4, and 1->4 should be removed.

        For this code, the fixers dict is {(3, 1): ((1, 4), (3, 4))}.  The key
        is the actual measured arc from the end of the with block back to the
        start of the with-statement.  The values are start_next (the with
        statement to the next statement after the with), and end_next (the end
        of the with-statement to the next statement after the with).

        With nested with-statements, we have to trace through a few levels to
        correct a longer chain of arcs.

        r   r   )r4   r=   rm   )r@   r˜   Ú	to_removeÚto_addÚarcÚend0Ú
start_nextÚend_nexts           r%   r—   zPythonParser.fix_with_jumpsr  sÜ   € ô0 “Eˆ	Ü“ˆÛˆCØ�d×,Ñ,Ò,Ø˜1‘v�Ø—‘˜cÔ"Ø'+×'=Ñ'=¸cÑ'BÑ$�
˜HØ  D×$:Ñ$:Ñ:Ø—M‘M *Ô-Ø+/×+AÑ+AÀ*Ñ+MÑ(�J Ø—M‘M (Ô+ð ! D×$:Ñ$:Ò:ð —
‘
˜D (¨1¡+Ð.Ô/Ø—‘˜jÕ)ð ô �D“	˜FÑ" iÑ/ˆØˆr'   c                ó0  — | j                   €t        j                  t        «      }| j	                  «       D ]L  \  }}|dkD  sJ d|›d| j
                  › �«       ‚|| j                  v rŒ1|| j                  v rŒ@||xx   dz  cc<   ŒN || _         | j                   S )zYGet a count of exits from that each line.

        Excluded lines are excluded.

        r   zl1=z  should be greater than zero in r   )r?   ÚcollectionsÚdefaultdictr|   r˜   r/   r6   )r@   Úexit_countsr¯   r°   s       r%   r½   zPythonParser.exit_countsš  s™   € ð ×ÑÐ$Ü.9×.EÑ.EÄcÓ.JˆKØŸ)™)ž+‘��BØ˜A’vÐV # " Ð&FÀtÇ}Á}ÀoÐVÓV�vØ˜Ÿ™Ñ&àØ˜Ÿ™Ñ&àØ˜B“ 1Ñ$”ð &ð !,ˆDÔà× Ñ Ð r'   c                óB   — |€
|dk  rd}nd}|j                  |¬«      }|S )z=Apply some defaulting and formatting to an arc's description.r   zjump to the function exitzjump to line {lineno}rb   )Úformat)r@   Ú
action_msgrY   s      r%   Ú_finish_action_msgzPythonParser._finish_action_msg¯  s2   € àÐØ�QŠwØ8‘
à4�
Ø×&Ñ&¨cÐ&Ó2ˆ
ØÐr'   c                óX  — | j                   €| j                  «        | j                   €J ‚| j                   j                  ||fdg«      }g }|D ]J  \  }}| j                  ||«      }d|› d|› �}|�|d|j	                  |¬«      › �z  }|j                  |«       ŒL dj                  |«      S )z5Provide an English sentence describing a missing arc.©NNzline z didn't z	 because rb   z or )r<   r§   rH   rÁ   r¿   ÚappendÚjoin)r@   rX   rY   Úfragment_pairsÚmsgsÚmissing_cause_msgrÀ   Úmsgs           r%   Úmissing_arc_descriptionz$PythonParser.missing_arc_description¹  sÇ   € à×&Ñ&Ð.Ø×ÑÔØ×.Ñ.Ð:Ð:Ð:à×4Ñ4×8Ñ8¸%À¸ÈÀ~ÓVˆàˆÛ-;Ñ)Ð˜zØ×0Ñ0°¸SÓAˆJØ˜%˜ ¨¨Ð5ˆCØ Ð,Ø˜Ð#4×#;Ñ#;À5Ð#;Ó#IÐ"JÐKÑK�à�K‰K˜Õð .<ð �{‰{˜4Ó Ð r'   c                óÈ   — | j                   €| j                  «        | j                   €J ‚| j                   j                  ||fdg«      }| j                  |d   d   |«      }|S )z2Provide an English description of an arc's effect.rÃ   r   r   )r<   r§   rH   rÁ   )r@   rX   rY   rÆ   rÀ   s        r%   Úarc_descriptionzPythonParser.arc_descriptionÌ  sl   € à×&Ñ&Ð.Ø×ÑÔØ×.Ñ.Ð:Ð:Ð:à×4Ñ4×8Ñ8¸%À¸ÈÀ~ÓVˆØ×,Ñ,¨^¸AÑ->¸qÑ-AÀ3ÓGˆ
ØÐr'   )NNN)r)   ú
str | Noner/   rÍ   r2   rÍ   ÚreturnÚNone)rS   r{   rÎ   úset[TLineNo]©rÎ   rÏ   )r$   r   rÎ   r   )r’   úIterable[TLineNo]rÎ   rÐ   )r”   rÒ   rÎ   rÐ   )r˜   zIterable[TArc]rÎ   ú	set[TArc])rÎ   rÓ   )rÎ   zdict[TLineNo, int])rÀ   rÍ   rY   r   rÎ   r{   )rX   r   rY   r   rÎ   r{   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__rB   r\   r�   r   ro   r•   r›   r¥   r˜   r§   r—   r½   rÁ   rÊ   rÌ   © r'   r%   r,   r,   D   sŽ   „ ñð  Ø#Ø"ð	@<àð@<ð ð@<ð ð	@<ð
 
ó@<óDó.pbód	ó?ó'óbó<ó0
óó6&óP!ó*ó!ô&r'   r,   T)ÚfrozenÚorderc                  ó*   — e Zd ZU dZded<   dZded<   y)ÚArcStarta?  The information needed to start an arc.

    `lineno` is the line number the arc starts from.

    `cause` is an English text fragment used as the `missing_cause_msg` for
    AstArcAnalyzer.missing_arc_fragments.  It will be used to describe why an
    arc wasn't executed, so should fit well into a sentence of the form,
    "Line 17 didn't run because {cause}."  The fragment can include "{lineno}"
    to have `lineno` interpolated into it.

    As an example, this code::

        if something(x):        # line 1
            func(x)             # line 2
        more_stuff()            # line 3

    would have two ArcStarts:

    - ArcStart(1, "the condition on line 1 was always true")
    - ArcStart(1, "the condition on line 1 was never true")

    The first would be used to create an arc from 1 to 3, creating a message like
    "line 1 didn't jump to line 3 because the condition on line 1 was always true."

    The second would be used for the arc from 1 to 2, creating a message like
    "line 1 didn't jump to line 2 because the condition on line 1 was never true."

    r   r$   Ú r{   ÚcauseN)rÔ   rÕ   rÖ   r×   Ú__annotations__rÞ   rØ   r'   r%   rÜ   rÜ   Ü  s   … ñð: ƒOØ€Eˆ3„Or'   rÜ   c                  ó0   — e Zd ZdZ	 	 d	 	 	 	 	 	 	 	 	 dd„Zy)Ú	TAddArcFnz&The type for AstArcAnalyzer.add_arc().Nc                 ó   — y)ab  
        Record an arc from `start` to `end`.

        `missing_cause_msg` is a description of the reason the arc wasn't
        taken if it wasn't taken.  For example, "the condition on line 10 was
        never true."

        `action_msg` is a description of what the arc does, like "jump to line
        10" or "exit from function 'fooey'."

        NrØ   ©r@   rX   rY   rÈ   rÀ   s        r%   Ú__call__zTAddArcFn.__call__  s   € ð$ 	r'   rÃ   ©
rX   r   rY   r   rÈ   rÍ   rÀ   rÍ   rÎ   rÏ   )rÔ   rÕ   rÖ   r×   rä   rØ   r'   r%   rá   rá   ÿ  sB   „ Ù0ð )-Ø!%ðàðð ðð &ð	ð
 ðð 
ôr'   rá   c                  ó0   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zy)ÚBlocka;  
    Blocks need to handle various exiting statements in their own ways.

    All of these methods take a list of exits, and a callable `add_arc`
    function that they can use to add arcs if needed.  They return True if the
    exits are handled, or False if the search should continue up the block
    stack.
    c                 ó   — y)zProcess break exits.FrØ   ©r@   ÚexitsÚadd_arcs      r%   Úprocess_break_exitszBlock.process_break_exits%  ó   € àr'   c                 ó   — y)zProcess continue exits.FrØ   ré   s      r%   Úprocess_continue_exitszBlock.process_continue_exits)  rí   r'   c                 ó   — y)zProcess raise exits.FrØ   ré   s      r%   Úprocess_raise_exitszBlock.process_raise_exits-  rí   r'   c                 ó   — y)zProcess return exits.FrØ   ré   s      r%   Úprocess_return_exitszBlock.process_return_exits1  rí   r'   N©rê   úset[ArcStart]rë   rá   rÎ   Úbool)rÔ   rÕ   rÖ   r×   rì   rï   rñ   ró   rØ   r'   r%   rç   rç     s   „ ñóóóôr'   rç   c                  ó(   — e Zd ZdZdd„Zdd„Zdd„Zy)Ú	LoopBlockz@A block on the block stack representing a `for` or `while` loop.c                ó0   — || _         t        «       | _        y rG   )rX   r4   Úbreak_exits)r@   rX   s     r%   rB   zLoopBlock.__init__9  s   € àˆŒ
ä*-«%ˆÕr'   c                ó:   — | j                   j                  |«       y©NT)rú   rR   ré   s      r%   rì   zLoopBlock.process_break_exits?  s   € Ø×Ñ×Ñ Ô&Ør'   c                ób   — |D ]*  } ||j                   | j                  |j                  «       Œ, yrü   )r$   rX   rÞ   ©r@   rê   rë   Úxits       r%   rï   z LoopBlock.process_continue_exitsC  s'   € ÛˆCÙ�C—J‘J §
¡
¨C¯I©IÕ6ð àr'   N)rX   r   rÎ   rÏ   rô   )rÔ   rÕ   rÖ   r×   rB   rì   rï   rØ   r'   r%   rø   rø   6  s   „ ÙJó0óôr'   rø   c                  ó(   — e Zd ZdZdd„Zdd„Zdd„Zy)ÚFunctionBlockz>A block on the block stack representing a function definition.c                ó    — || _         || _        y rG   ©rX   Úname)r@   rX   r  s      r%   rB   zFunctionBlock.__init__L  s   € àˆŒ
àˆ�	r'   c                ó€   — |D ]9  } ||j                   | j                   |j                  d| j                  ›�«       Œ; y)Nzexcept from function T©r$   rX   rÞ   r  rþ   s       r%   rñ   z!FunctionBlock.process_raise_exitsR  ó>   € ÛˆCÙØ—
‘
Ø—‘�Ø—	‘	Ø'¨¯	©	 }Ð5õ	ð ð r'   c                ó€   — |D ]9  } ||j                   | j                   |j                  d| j                  ›�«       Œ; y)Nzreturn from function Tr  rþ   s       r%   ró   z"FunctionBlock.process_return_exits\  r  r'   N)rX   r   r  r{   rÎ   rÏ   rô   )rÔ   rÕ   rÖ   r×   rB   rñ   ró   rØ   r'   r%   r  r  I  s   „ ÙHóóôr'   r  c                  ó    — e Zd ZdZdd„Zdd„Zy)ÚTryBlockz6A block on the block stack representing a `try` block.c                ó    — || _         || _        y rG   )Úhandler_startÚfinal_start)r@   r  r  s      r%   rB   zTryBlock.__init__j  s   € à*ˆÔà&ˆÕr'   c                óz   — | j                   �/|D ]*  } ||j                  | j                   |j                  «       Œ, yrü   )r  r$   rÞ   rþ   s       r%   rñ   zTryBlock.process_raise_exitsp  s5   € Ø×ÑÐ)Û�Ù˜Ÿ
™
 D×$6Ñ$6¸¿	¹	ÕBð àr'   N)r  úTLineNo | Noner  r  rÎ   rÏ   rô   )rÔ   rÕ   rÖ   r×   rB   rñ   rØ   r'   r%   r
  r
  g  s   „ Ù@ó'ôr'   r
  c              #  ó¾   K  — | g}|rT|j                  «       }|–— t        j                  |«      D ]$  }t        |t        «      sŒ|j                  |«       Œ& |rŒSyy­w)aÄ  Yield `root` and its descendant statement-level nodes.

    Like ast.walk, but skips expression subtrees entirely, since statements
    (including def and class) can never appear inside them.  This visits a
    small fraction of the nodes ast.walk does, which matters when scanning
    many files during reporting.

    ExceptHandler and match_case nodes are also yielded; callers only
    interested in particular node types must check for them.

    N)Úpoprr   Úiter_child_nodesrq   Ú_STMT_CONTAINERSrÄ   )ÚrootÚtodor‹   Úchilds       r%   rp   rp   €  sS   è ø€ ð ˆ6€DÙ
Ø�x‰x‹zˆØŠ
Ü×)Ñ)¨$Ö/ˆEÜ˜%Ô!1Õ2Ø—‘˜EÕ"ð 0ô ùs   ‚AAÁAÁAc                óÂ  — | j                   �y| j                  }t        |t        j                  «      r*|j
                  d   }t        |t        j                  «      rŒ*t        |t        j                  «      r?|j                  �3|j                  }t        |t        j                  «      r|j                  �Œ3t        |t        j                  «      xr |j                  du S )zñWill this `case` clause always match, like `case _:` does?

    An irrefutable case has a wildcard or bare-capture pattern and no guard,
    so anything reaching it will match.  These are the `match` equivalent of
    an `else` clause.

    NFre   )Úguardr‚   rq   rr   ÚMatchOrÚpatternsÚMatchAs)Úcaser‚   s     r%   r�   r�   •  s    € ð ‡z�zÐØØ�l‰l€GÜ
�WœcŸk™kÔ
*Ø×"Ñ" 2Ñ&ˆô �WœcŸk™kÕ
*ä
�WœcŸk™kÔ
*¨w¯©Ð/JØ—/‘/ˆô �WœcŸk™kÔ
*¨w¯©Ñ/Jä�gœsŸ{™{Ó+ÒG°·±À4Ð0GÐGr'   c                óº  — | xt         j                  d˜ x�\    dt        | j                  «      fS  xt         j                  d˜ x�)\    | j
                  dv rdt        | j
                  «      fS y xt         j                  d˜ x�E\    t        | j                  t         j                  «      rt        | j                  «      \  }}|| fS y t         j                  d˜ x�z\   | j                  D �cg c]  }t        |«      ‘Œ }}t        d„ |D «       «      }|rAt        | j                  t         j                   «      rt"        nt        }d |d„ |D «       «      fS y yc c}w )zÊIs this a compile-time constant test expression?

    We don't try to mimic all of CPython's optimizations.  We just have to
    handle the kinds of constant expressions people might actually use.

    rØ   T)ÚTrueÚFalserÏ   Ú	__debug__c              3  ó&   K  — | ]	  \  }}|–— Œ y ­wrG   rØ   )rI   Úis_constr"   s      r%   rK   z(is_constant_test_expr.<locals>.<genexpr>º  s   è ø€ Ð?¹$©;¨8°Qœh¹$ùó   ‚c              3  ó&   K  — | ]	  \  }}|–— Œ y ­wrG   rØ   )rI   r"   Úvs      r%   rK   z(is_constant_test_expr.<locals>.<genexpr>½  s   è ø€ Ð3©d¡d a¨¤©dùr#  )FF)rr   rz   rö   ry   ÚNameÚidÚevalÚUnaryOprq   ÚopÚNotÚis_constant_test_exprÚoperandÚBoolOpÚvaluesÚallÚOrÚany)r‹   Úis_constantÚvalr%  Úretsr*  s         r%   r,  r,  §  s&  € ð ØŒS�\‰\Ž^Øœ˜dŸj™jÓ)Ð)Ð)ð àŒS�X‰XŽZØ�w‰wÐ@Ñ@ØœT $§'¡'›]Ð*Ð*ð ð ð ŒS�[‰[Ž]Ü˜$Ÿ'™'¤3§7¡7Ô+Ü#8¸¿¹Ó#FÑ �˜SØ"¨ GÐ+Ð+ð ð ô �Z‰Z�\Ø6:·k²kÓB±k°Ô)¨!Õ,°kˆDÐBÜÑ?¹$Ó?Ó?ˆKÙÜ& t§w¡w´·±Ô7•S¼S�Ø™RÑ3©dÓ3Ó3Ð3Ð3Øð ð ùò Cs   Ã,Ec                  ó|  — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 d#d„Zd$d„Zd%d„Zd&d„Zd'd„Zd(d„Z		 	 d)	 	 	 	 	 	 	 	 	 d*d	„Z
d+d
„Zd,d„Zd-d„Zd.d„ZeZd/d„ZeZeZd0d„Zd1d„Z ed«      Zd2d„Z	 	 d)	 	 	 	 	 	 	 d3d„Zd4d„Zd4d„Zd4d„Zd4d„Zd5d„Zd6d„ZeZd7d„Z d8d„Z!e!Z"eZ#eZ$d9d„Z%d:d„Z&d;d„Z'd<d„Z(d=d „Z)e)Z*d>d!„Z+d?d"„Z,e,Z-y)@rª   aó  Analyze source text with an AST to find executable code paths.

    The .analyze() method does the work, and populates these attributes:

    `arcs`: a set of (from, to) pairs of the the arcs possible in the code.

    `missing_arc_fragments`: a dict mapping (from, to) arcs to lists of
    message fragments explaining why the arc is missing from execution::

        { (start, end): [(missing_cause_msg, action_msg), ...], }

    For an arc starting from line 17, they should be usable to form complete
    sentences like: "Line 17 didn't {action_msg} because {missing_cause_msg}".

    NOTE: Starting in July 2024, I've been whittling this down to only report
    arc that are part of true branches.  It's not clear how far this work will
    go.

    c                óÆ  — || _         || _        |D �ch c]  }|j                  ||«      ’Œ c}| _        || _        t        t        t        j                  dd«      «      «      }|r[t        d| j                  › �«       t        d| j                  › �«       t        t        j                  | j                  dd¬«      «       t        «       | _        t        j                  t         «      | _        g | _        t        «       | _        t        «       | _        t        «       | _        t        «       | _        t        t        t        j                  dd«      «      «      | _        y c c}w )	NÚCOVERAGE_AST_DUMPÚ0zStatements: zMultiline map: Té   )Úinclude_attributesrƒ   ÚCOVERAGE_TRACK_ARCS)r/   Ú	root_noderH   r5   Ú	multilinerö   r|   ÚosÚgetenvrg   rr   Údumpr4   r˜   r»   r¼   rf   r­   Úblock_stackÚcurrent_with_startsÚall_with_startsÚwith_entriesÚ
with_exitsÚdebug)r@   r/   r=  r5   r>  r$   Údump_asts          r%   rB   zAstArcAnalyzer.__init__Ö  s  € ð !ˆŒØ"ˆŒÙGQÓRÁz¸V˜9Ÿ=™=¨°Õ8ÀzÑRˆŒØ"ˆŒô œœBŸI™IÐ&9¸3Ó?Ó@ÓAˆáä�L §¡Ð 1Ð2Ô3Ü�O D§N¡NÐ#3Ð4Ô5Ü”#—(‘(˜4Ÿ>™>¸dÈ1ÔMÔNä"›uˆŒ	Ü4?×4KÑ4KÌDÓ4QˆÔ"Ø(*ˆÔô 25³ˆÔ Ü-0«UˆÔÜ'*£uˆÔÜ%(£UˆŒô œ#œbŸi™iÐ(=¸sÓCÓDÓEˆ�
ùò7 Ss   “Ec                ó`  — t        | j                  «      D ]–  }t        |t        j                  t        j
                  f«      r| j                  |«       Œ?t        |t        j                  «      r| j                  |«       Œkt        |t        j                  «      sŒ†| j                  |«       Œ˜ y)zFExamine the AST tree from `self.root_node` to determine possible arcs.N)rp   r=  rq   rr   rt   ru   Ú_code_object__FunctionDefrs   Ú_code_object__ClassDefrv   Ú_code_object__Module©r@   r‹   s     r%   r«   zAstArcAnalyzer.analyzeü  st   € ä(¨¯©Ö8ˆDÜ˜$¤§¡´#×2FÑ2FÐ GÔHØ×.Ñ.¨tÕ4Ü˜D¤#§,¡,Ô/Ø×+Ñ+¨DÕ1Ü˜D¤#§*¡*Õ-Ø×)Ñ)¨$Õ/ñ 9r'   c                ó¾  — i }| j                   D �ch c]#  }|d   | j                  v r|| j                  vr|’Œ% }}| j                  D ]„  }|D �ch c]  }|d   |k(  sŒ|d   ’Œ }}|sŒ!t        |«      dk(  sJ d|› d|›�«       ‚|j	                  «       }| j
                  D �ch c]  }|d   |k(  sŒ|d   ’Œ }}|D ]  }||f||ff|||f<   Œ Œ† |S c c}w c c}w c c}w )aK  Get a dict with data for fixing jumps out of with statements.

        Returns a dict.  The keys are arcs leaving a with-statement by jumping
        back to its start.  The values are pairs: first, the arc from the start
        to the next statement, then the arc that exits the with without going
        to the start.

        r   r   zExpected one arc, got z with start = )r˜   rD  rE  Úlenr  rF  )	r@   Úfixersr¶   Ú
with_nextsrX   ÚnextsÚnxtÚendsrY   s	            r%   r¬   zAstArcAnalyzer.with_jump_fixers  s  € ð ˆð —y’yó
á �Ø�1‰v˜×-Ñ-Ñ-°#¸T×=NÑ=NÑ2Nò Ø ð 	ð 
ð
 ×)Ô)ˆEÙ'1ÓE¡z °S¸±V¸u³_�S˜“V zˆEÐEÙØÜ�u“: ’?ÐTÐ&<¸U¸GÀ?È%ÈÐ$TÓT�?Ø—)‘)“+ˆCØ&*§o¢oÓI¡o˜s¸¸Q¹À5»�C˜“F oˆDÐIÛ�Ø).°¨°s¸C°jÐ'A�˜˜U�|Ò$ñ ð *ð ˆùò
ùò Fùò
 Js   ‘(CÁCÁCÂ!CÂ/Cc                óü   — | j                  |«      }|j                  rL| j                  |j                  «      }|D ]+  }| j                  |j                  | |j
                  d«       Œ- y | j                  || «       y )Nzexit the module)Úline_for_noderw   Úprocess_bodyrë   r$   rÞ   ©r@   r‹   rX   rê   rÿ   s        r%   rL  z#AstArcAnalyzer._code_object__Module%  sf   € Ø×"Ñ" 4Ó(ˆØ�9Š9Ø×%Ñ% d§i¡iÓ0ˆEÛ�Ø—‘˜SŸZ™Z¨%¨°·±Ð<MÕNñ ð �L‰L˜  Õ'r'   c                ó  — | j                  |«      }| j                  j                  t        ||j                  ¬«      «       | j                  |j                  «      }| j                  |«       | j                  j                  «        y )Nr  )	rV  rB  rÄ   r  r  rW  rw   ró   r  )r@   r‹   rX   rê   s       r%   rJ  z(AstArcAnalyzer._code_object__FunctionDef/  se   € Ø×"Ñ" 4Ó(ˆØ×Ñ×Ñ¤°EÀÇ	Á	Ô JÔKØ×!Ñ! $§)¡)Ó,ˆØ×!Ñ! %Ô(Ø×Ñ×ÑÕr'   c                óÖ   — | j                  |«      }| j                  |j                  «      }|D ]8  }| j                  |j                  | |j
                  d|j                  ›�«       Œ: y )Nzexit class )rV  rW  rw   rë   r$   rÞ   r  rX  s        r%   rK  z%AstArcAnalyzer._code_object__ClassDef6  sW   € Ø×"Ñ" 4Ó(ˆØ×!Ñ! $§)¡)Ó,ˆÛˆCØ�L‰L˜Ÿ™ e V¨S¯Y©Y¸+ÀdÇiÁiÀ]Ð8SÕTñ r'   Nc           
     óR  — | j                   r,t        d|› d|› d|›d|›�«       t        t        «       d¬«       | j                  j	                  ||f«       || j
                  v r| j                  j	                  ||f«       |€|�#| j                  ||f   j                  ||f«       yy)z@Add an arc, including message fragments to use if it is missing.zAdding possible arc: (z, z): z

)rY   N)	rG  rg   r   r˜   rm   rC  rE  r­   rÄ   rã   s        r%   rë   zAstArcAnalyzer.add_arc<  s­   € ð �:Š:ÜÐ*¨5¨'°°C°5¸Ð<MÐ;PÐPRÐS]ÐR`ÐaÔbÜ”+“- VÕ,Ø�	‰	�‰�u˜c�lÔ#Ø�D×,Ñ,Ñ,Ø×Ñ×!Ñ! 5¨# ,Ô/àÐ(¨JÐ,BØ×&Ñ&¨¨s |Ñ4×;Ñ;Ð=NÐPZÐ<[Õ\ð -Cr'   c                ó,   — t        | j                  «      S )z.Yield the blocks in nearest-to-farthest order.)ÚreversedrB  r¨   s    r%   Únearest_blockszAstArcAnalyzer.nearest_blocksN  s   € ä˜×(Ñ(Ó)Ð)r'   c                ó´   — |j                   j                  }t        | d|› �d«      }|�	 ||«      }n|j                  }| j                  j                  ||«      S )z}What is the right line number to use for this node?

        This dispatches to _line__Node functions where needed.

        Ú_line__N)Ú	__class__rÔ   Úgetattrr$   r>  rH   )r@   r‹   Ú	node_nameÚhandlerÚlines        r%   rV  zAstArcAnalyzer.line_for_nodeR  s^   € ð —N‘N×+Ñ+ˆ	Ü7>ØØ�i�[Ð!Øó8
ˆð
 ÐÙ˜4“=‰Dà—;‘;ˆDØ�~‰~×!Ñ! $¨Ó-Ð-r'   c                ól   — |j                   r|j                   d   j                  }|S |j                  }|S )zSCompute first line number for things that can be decorated (classes and functions).r   )r   r$   )r@   r‹   r$   s      r%   Ú_line_decoratedzAstArcAnalyzer._line_decoratedi  s8   € à×ÒØ×(Ñ(¨Ñ+×2Ñ2ˆFð ˆð —[‘[ˆFØˆr'   c                ó8   — | j                  |j                  «      S rG   )rV  ry   rM  s     r%   Ú_line__AssignzAstArcAnalyzer._line__Assignq  s   € Ø×!Ñ! $§*¡*Ó-Ð-r'   c                ó´   — |j                   rA|j                   d   �|j                   d   j                  S |j                  d   j                  S |j                  S ©Nr   )Úkeysr$   r/  rM  s     r%   Ú_line__DictzAstArcAnalyzer._line__Dictv  sK   € Ø�9Š9Ø�y‰y˜‰|Ð'Ø—y‘y ‘|×*Ñ*Ð*ð —{‘{ 1‘~×,Ñ,Ð,à—;‘;Ðr'   c                ón   — |j                   r| j                  |j                   d   «      S |j                  S rk  )ÚeltsrV  r$   rM  s     r%   Ú_line__ListzAstArcAnalyzer._line__List„  s,   € Ø�9Š9Ø×%Ñ% d§i¡i°¡lÓ3Ð3à—;‘;Ðr'   c                 ó   — y)Nr   rØ   rM  s     r%   Ú_line__ModulezAstArcAnalyzer._line__ModuleŠ  s   € Ør'   )Ú	AnnAssignÚAssignÚAssertÚ	AugAssignÚDeleterx   ÚGlobalÚImportÚ
ImportFromÚNonlocalÚPassc                óø   — |j                   j                  }t        | d|› �d«      }|�
 ||«      }|S t        j                  r|| j
                  vrt        d|› �«      ‚t        | j                  |«      «      h}|S )a  Find the set of arc starts that exit this node.

        Return a set of ArcStarts, exits from this node to the next. Because a
        node represents an entire sub-tree (including its children), the exits
        from a node can be arbitrarily complex::

            if something(1):
                if other(2):
                    doit(3)
                else:
                    doit(5)

        There are three exits from line 1: they start at lines 1, 3 and 5.
        There are two exits from line 2: lines 3 and 5.

        Ú	_handle__Nz*** Unhandled: )	ra  rÔ   rb  r
   ÚTESTINGÚOK_TO_DEFAULTÚRuntimeErrorrÜ   rV  )r@   r‹   rc  rd  Ú
arc_startss        r%   Ú
node_exitszAstArcAnalyzer.node_exitsž  s�   € ð" —N‘N×+Ñ+ˆ	Ü=DØØ˜	�{Ð#Øó>
ˆð
 ÐÙ  ›ˆJð Ðô �{Š{Ø D×$6Ñ$6Ñ6Ü&¨¸¸Ð'?Ó@Ð@ô # 4×#5Ñ#5°dÓ#;Ó<Ð=ˆJØÐr'   c                ó   — |€|€t        «       }n|h}n|�J ‚|D ]a  }| j                  |«      }|| j                  vrŒ#|D ])  }| j                  |j                  ||j
                  «       Œ+ | j                  |«      }Œc |S )aÛ  Process the body of a compound statement.

        `body` is the body node to process.

        `from_start` is a single `ArcStart` that starts an arc into this body.
        `prev_starts` is a set of ArcStarts that can all be the start of arcs
        into this body.  Only one of `from_start` and `prev_starts` should be
        given.

        Records arcs within the body by calling `self.add_arc`.

        Returns a set of ArcStarts, the exits from this body.

        )r4   rV  r5   rë   r$   rÞ   rƒ  )r@   rw   Ú
from_startÚprev_startsÚ	body_noder$   Ú
prev_starts          r%   rW  zAstArcAnalyzer.process_bodyÂ  s‘   € ð( ÐØÐ!Ü!›e‘à)˜l‘àÐ%Ð%Ð%ó ˆIØ×'Ñ'¨	Ó2ˆFØ˜TŸ_™_Ñ,ØÛ)�
Ø—‘˜Z×.Ñ.°¸
×8HÑ8HÕIð *àŸ/™/¨)Ó4‰Kð ð Ðr'   c                ój   — | j                  «       D ]   }|j                  || j                  «      sŒ  y y)z0Add arcs due to jumps from `exits` being breaks.N)r^  rì   rë   ©r@   rê   Úblocks      r%   rì   z"AstArcAnalyzer.process_break_exitsñ  ó,   € à×(Ñ(Ö*ˆEØ×(Ñ(¨°·±Õ=Ùñ +r'   c                ój   — | j                  «       D ]   }|j                  || j                  «      sŒ  y y)z3Add arcs due to jumps from `exits` being continues.N)r^  rï   rë   rŠ  s      r%   rï   z%AstArcAnalyzer.process_continue_exits÷  s,   € à×(Ñ(Ö*ˆEØ×+Ñ+¨E°4·<±<Õ@Ùñ +r'   c                ój   — | j                  «       D ]   }|j                  || j                  «      sŒ  y y)z0Add arcs due to jumps from `exits` being raises.N)r^  rñ   rë   rŠ  s      r%   rñ   z"AstArcAnalyzer.process_raise_exitsý  rŒ  r'   c                ój   — | j                  «       D ]   }|j                  || j                  «      sŒ  y y)z1Add arcs due to jumps from `exits` being returns.N)r^  ró   rë   rŠ  s      r%   ró   z#AstArcAnalyzer.process_return_exits  s,   € à×(Ñ(Ö*ˆEØ×)Ñ)¨%°·±Õ>Ùñ +r'   c                óv   — | j                  |«      }t        |d¬«      }| j                  |h«       t        «       S )Nz*the break on line {lineno} wasn't executed©rÞ   )rV  rÜ   rì   r4   )r@   r‹   ÚhereÚbreak_starts       r%   Ú_handle__BreakzAstArcAnalyzer._handle__Break  s6   € Ø×!Ñ! $Ó'ˆÜ˜tÐ+WÔXˆØ× Ñ  + Ô/Ü‹uˆr'   c                ó|  — |j                   }|j                   }|j                  }|r‡d}|D ].  }| j                  |«      }|�||k7  r| j                  ||«       |}Œ0 |€J ‚| j                  ||«       |}|j                  s.J d|j                  ›d| j
                  › d|j                   › �«       ‚|€J ‚t        |«      hS )zBAdd arcs for things that can be decorated (classes and functions).NzOops: node.body = z in Ú@)r$   r   rV  rë   rw   r/   rÜ   )r@   r‹   Ú	main_lineÚlastÚdecsÚdec_nodeÚ	dec_starts          r%   Ú_handle_decoratedz AstArcAnalyzer._handle_decorated  sÎ   € à!Ÿ[™[ˆ	Ø#Ÿ{™{ˆØ×"Ñ"ˆÙØˆDÛ �Ø ×.Ñ.¨xÓ8�	ØÐ#¨	°TÒ(9Ø—L‘L  yÔ1Ø ‘ð	 !ð
 Ð#Ð#Ð#Ø�L‰L˜˜yÔ)ØˆDð
 —9’9ÐVÐ 3 t§y¡y n°D¸¿¹¸ÀqÈÏÉÈÐVÓV�9àÐÐÐÜ˜“ÐÐr'   c                óv   — | j                  |«      }t        |d¬«      }| j                  |h«       t        «       S )Nz-the continue on line {lineno} wasn't executedr‘  )rV  rÜ   rï   r4   )r@   r‹   r’  Úcontinue_starts       r%   Ú_handle__Continuez AstArcAnalyzer._handle__Continue4  s7   € Ø×!Ñ! $Ó'ˆÜ! $Ð.]Ô^ˆØ×#Ñ# ^Ð$4Ô5Ü‹uˆr'   c                óB  — | j                  |j                  «      }| j                  j                  t	        |¬«      «       t        |d¬«      }| j                  |j                  |¬«      }|D ])  }| j                  |j                  ||j                  «       Œ+ | j                  j                  «       }t        |t        «      sJ ‚|j                  }t        |d¬«      }|j                  r$| j                  |j                  |¬«      }||z  }|S |j                  |«       |S )N©rX   z'the loop on line {lineno} never startedr‘  ©r…  z)the loop on line {lineno} didn't complete)rV  ÚiterrB  rÄ   rø   rÜ   rW  rw   rë   r$   rÞ   r  rq   rú   Úorelserm   )r@   r‹   rX   r…  rê   rÿ   Úmy_blockÚ
else_exitss           r%   Ú_handle__ForzAstArcAnalyzer._handle__For:  s÷   € Ø×"Ñ" 4§9¡9Ó-ˆØ×Ñ×Ñ¤	°Ô 6Ô7Ü˜eÐ+TÔUˆ
Ø×!Ñ! $§)¡)¸
Ð!ÓCˆãˆCØ�L‰L˜Ÿ™ U¨C¯I©IÕ6ð à×#Ñ#×'Ñ'Ó)ˆÜ˜(¤IÔ.Ð.Ð.Ø×$Ñ$ˆÜ˜eÐ+VÔWˆ
Ø�;Š;Ø×*Ñ*¨4¯;©;À:Ð*ÓNˆJØ�ZÑˆEð ˆð �I‰I�jÔ!Øˆr'   c                óD  — | j                  |j                  «      }t        |j                  «      \  }}t        «       }|r|r-t	        |d¬«      }|| j                  |j                  |¬«      z  }|r|s-t	        |d¬«      }|| j                  |j                  |¬«      z  }|S )Nú-the condition on line {lineno} was never truer‘  r¢  ú.the condition on line {lineno} was always true)rV  Útestr,  r4   rÜ   rW  rw   r¤  )r@   r‹   rX   Úconstant_testr4  rê   r…  s          r%   Ú_handle__IfzAstArcAnalyzer._handle__IfS  s•   € Ø×"Ñ" 4§9¡9Ó-ˆÜ2°4·9±9Ó=Ñˆ�sÜ“ˆÙ¡Ü! %Ð/^Ô_ˆJØ�T×&Ñ& t§y¡y¸ZÐ&ÓHÑHˆEÙ¡CÜ! %Ð/_Ô`ˆJØ�T×&Ñ& t§{¡{¸zÐ&ÓJÑJˆEØˆr'   c                ón  — | j                  |«      }|}t        «       }|j                  D ]_  }| j                  |j                  «      }| j	                  ||d«       t        |d¬«      }|| j                  |j                  |¬«      z  }|}Œa t        «      }|s|j                  t        d¬«      «       |S )Nz+the pattern on line {lineno} always matchedz*the pattern on line {lineno} never matchedr‘  r¢  )
rV  r4   Úcasesr‚   rë   rÜ   rW  rw   r�   rm   )	r@   r‹   rX   rU   rê   r  Ú
case_startr…  Úhad_wildcards	            r%   Ú_handle__MatchzAstArcAnalyzer._handle__Match_  s³   € Ø×"Ñ" 4Ó(ˆØˆ
Ü“ˆØ—J”JˆDØ×+Ñ+¨D¯L©LÓ9ˆJØ�L‰L˜ ZÐ1^Ô_Ü!ØØBôˆJð �T×&Ñ& t§y¡y¸ZÐ&ÓHÑHˆEØ#‰Jð ô ,¨DÓ1ˆáØ�I‰IÜ˜Ð+XÔYôð ˆr'   c                óv   — | j                  |«      }t        |d¬«      }| j                  |h«       t        «       S )Nz*the raise on line {lineno} wasn't executedr‘  )rV  rÜ   rñ   r4   )r@   r‹   r’  Úraise_starts       r%   Ú_handle__RaisezAstArcAnalyzer._handle__Raisev  s6   € Ø×!Ñ! $Ó'ˆÜ˜tÐ+WÔXˆØ× Ñ  + Ô/ä‹uˆr'   c                óv   — | j                  |«      }t        |d¬«      }| j                  |h«       t        «       S )Nz+the return on line {lineno} wasn't executedr‘  )rV  rÜ   ró   r4   )r@   r‹   r’  Úreturn_starts       r%   Ú_handle__ReturnzAstArcAnalyzer._handle__Return}  s6   € Ø×!Ñ! $Ó'ˆÜ Ð,YÔZˆØ×!Ñ! < .Ô1ä‹uˆr'   c                óš  — |j                   r| j                  |j                   d   «      }nd }|j                  r| j                  |j                  d   «      }nd }|€|€J ‚t        ||«      }| j                  j                  |«       | j                  |«      }| j                  |j                  t        |«      ¬«      }|j                  rd |_	        n| j                  j                  «        t        «       }|j                   rQ|j                   D ]B  }| j                  |«      }d}	t        ||	¬«      }
|| j                  |j                  |
¬«      z  }ŒD |j                  r| j                  |j                  |¬«      }||z  }|j                  r=| j                  j                  «        |}| j                  |j                  |¬«      }|r|}|S )Nr   r¢  z3the exception caught by line {lineno} didn't happenr‘  )r†  )ÚhandlersrV  Ú	finalbodyr
  rB  rÄ   rW  rw   rÜ   r  r  r4   r¤  )r@   r‹   r  r  Ú	try_blockrX   rê   Úhandler_exitsÚhandler_nodeÚ
from_causer…  Ú
final_fromÚfinal_exitss                r%   Ú_handle__TryzAstArcAnalyzer._handle__Try„  sŸ  € Ø�=Š=Ø ×.Ñ.¨t¯}©}¸QÑ/?Ó@‰Mà ˆMà�>Š>Ø×,Ñ,¨T¯^©^¸AÑ->Ó?‰KàˆKð Ð(¨KÐ,CÐCÐCÜ˜]¨KÓ8ˆ	Ø×Ñ×Ñ 	Ô*à×"Ñ" 4Ó(ˆØ×!Ñ! $§)¡)¼À»Ð!ÓHˆð
 �>Š>Ø&*ˆIÕ#à×Ñ× Ñ Ô"ä'*£uˆà�=Š=Ø $§¤�Ø $× 2Ñ 2°<Ó @�ØR�
Ü% m¸:ÔF�
Ø ×!2Ñ!2°<×3DÑ3DÐQ[Ð!2Ó!\Ñ\‘ð	 !.ð �;Š;Ø×%Ñ% d§k¡k¸uÐ%ÓEˆEà�Ñˆà�>Š>Ø×Ñ× Ñ Ô"ØˆJà×+Ñ+¨D¯N©NÈ
Ð+ÓSˆKáð $�àˆr'   c                ó¬  — | j                  |j                  «      x}}t        |j                  «      \  }}| j                  j	                  t        |¬«      «       t        |d¬«      }| j                  |j                  |¬«      }|D ])  }| j                  |j                  ||j                  «       Œ+ t        «       }| j                  j                  «       }	t        |	t
        «      sJ ‚|j                  |	j                   «       t        |d¬«      }|j"                  r$| j                  |j"                  |¬«      }
||
z  }|S |s|j%                  |«       |S )Nr¡  r©  r‘  r¢  rª  )rV  r«  r,  rB  rÄ   rø   rÜ   rW  rw   rë   r$   rÞ   r4   r  rq   rR   rú   r¤  rm   )r@   r‹   rX   Úto_topr¬  r"   r…  rê   rÿ   r¥  r¦  s              r%   Ú_handle__WhilezAstArcAnalyzer._handle__While½  s   € Ø×+Ñ+¨D¯I©IÓ6Ð6ˆ�Ü0°·±Ó;Ñˆ�qØ×Ñ×Ñ¤	°Ô 7Ô8Ü˜eÐ+ZÔ[ˆ
Ø×!Ñ! $§)¡)¸
Ð!ÓCˆÛˆCØ�L‰L˜Ÿ™ V¨S¯Y©YÕ7ð ä“ˆØ×#Ñ#×'Ñ'Ó)ˆÜ˜(¤IÔ.Ð.Ð.Ø�‰�X×)Ñ)Ô*Ü˜eÐ+[Ô\ˆ
Ø�;Š;Ø×*Ñ*¨4¯;©;À:Ð*ÓNˆJØ�ZÑˆEð
 ˆñ !Ø—	‘	˜*Ô%Øˆr'   c                óŽ  — t         j                  j                  r3|j                  D �cg c]  }| j	                  |j
                  «      ‘Œ }}n| j	                  |«      g}|D ]8  }| j                  j                  |«       | j                  j                  |«       Œ: | j                  |j                  t        |d   «      ¬«      }|d   }| j                  j                  |«       t        |«      h}|rL|D ]E  }| j                  |j                  |«       | j                  j                  |j                  |f«       ŒG |}|S c c}w )Nre   r¢  )r
   Ú
PYBEHAVIORÚexit_with_through_ctxmgrÚitemsrV  Úcontext_exprrC  rm   rD  rW  rw   rÜ   Úremoverë   r$   rF  )r@   r‹   Úitemr¤   rX   rê   Ú	with_exitrÿ   s           r%   Ú_handle__WithzAstArcAnalyzer._handle__WithÓ  s  € Ü�>‰>×2Ò2ØHLÏ
Ê
ÓSÉ
À�d×(Ñ(¨×):Ñ):Õ;È
ˆFÑSà×(Ñ(¨Ó.Ð/ˆFÛˆEØ×$Ñ$×(Ñ(¨Ô/Ø× Ñ ×$Ñ$ UÕ+ð ð ×!Ñ! $§)¡)¼ÀÈÁÓ8LÐ!ÓMˆà�r‘
ˆØ× Ñ ×'Ñ'¨Ô.Ü˜e“_Ð%ˆ	ÙÛ�Ø—‘˜SŸZ™Z¨Ô/Ø—‘×#Ñ# S§Z¡Z°Ð$7Õ8ð ð ˆEàˆùò% Ts   ©"E)
r/   r{   r=  úast.ASTr5   rÐ   r>  údict[TLineNo, TLineNo]rÎ   rÏ   rÑ   )rÎ   zdict[TArc, tuple[TArc, TArc]])r‹   ú
ast.ModulerÎ   rÏ   )r‹   z&ast.FunctionDef | ast.AsyncFunctionDefrÎ   rÏ   )r‹   zast.ClassDefrÎ   rÏ   rÃ   rå   )rÎ   zIterable[Block])r‹   rÏ  rÎ   r   )r‹   úast.FunctionDefrÎ   r   )r‹   z
ast.AssignrÎ   r   )r‹   zast.DictrÎ   r   )r‹   zast.ListrÎ   r   )r‹   rÑ  rÎ   r   )r‹   rÏ  rÎ   rõ   )rw   zSequence[ast.AST]r…  zArcStart | Noner†  zset[ArcStart] | NonerÎ   rõ   )rê   rõ   rÎ   rÏ   )r‹   z	ast.BreakrÎ   rõ   )r‹   rÒ  rÎ   rõ   )r‹   zast.ContinuerÎ   rõ   )r‹   zast.ForrÎ   rõ   )r‹   zast.IfrÎ   rõ   )r‹   z	ast.MatchrÎ   rõ   )r‹   z	ast.RaiserÎ   rõ   )r‹   z
ast.ReturnrÎ   rõ   )r‹   zast.TryrÎ   rõ   )r‹   z	ast.WhilerÎ   rõ   )r‹   zast.WithrÎ   rõ   ).rÔ   rÕ   rÖ   r×   rB   r«   r¬   rL  rJ  rK  rë   r^  rV  rg  ri  Ú_line__ClassDefrm  Ú_line__FunctionDefÚ_line__AsyncFunctionDefrp  rr  Ú	frozensetr€  rƒ  rW  rì   rï   rñ   ró   r”  rœ  Ú_handle__ClassDefrŸ  r§  Ú_handle__AsyncForÚ_handle__FunctionDefÚ_handle__AsyncFunctionDefr­  r²  rµ  r¸  rÂ  Ú_handle__TryStarrÅ  rÎ  Ú_handle__AsyncWithrØ   r'   r%   rª   rª   Á  s›  „ ñð($Fàð$Fð ð$Fð !ð	$Fð
 *ð$Fð 
ó$FóL0óó>(óóUð )-Ø!%ð]àð]ð ð]ð &ð	]ð
 ð]ð 
ó]ó$*ó.ó.ó.ð &€Oó	ð )ÐØ-Ðóóñ ð	
ó€Mó "ðN '+Ø,0ð	%àð%ð $ð%ð *ð	%ð
 
ó%ó^óóóó"ó ð0 *Ðóóð( %Ðà,ÐØ 1Ðó
óó.óó5ðn $Ðóó,ð, 'Ñr'   rª   )r   zIterable[tokenize.TokenInfo]rÎ   rÐ  )r)   r{   rÎ   rÐ  )r  rÏ  rÎ   zIterable[ast.AST])r  zast.match_caserÎ   rö   )r‹   rÏ  rÎ   ztuple[bool, bool])9r×   Ú
__future__r   rr   r»   r?  rM   r   r   Úcollections.abcr   r   r   Údataclassesr   Útypingr   r	   Úcoverager
   Úcoverage.bytecoder   Úcoverage.debugr   Úcoverage.exceptionsr   r   Úcoverage.miscr   r   Úcoverage.phystokensr   Úcoverage.typesr   r   r&   r*   r,   rÜ   rá   Údictrf   Útupler{   ÚTArcFragmentsrç   rø   r  r
  ÚstmtÚexcepthandlerr€   r  rp   r�   r,  rª   rØ   r'   r%   Ú<module>rí     s  ðñ $å "ã 
Û Û 	Û 	Û Û ß 8Ñ 8Ý !ß !å Ý (Ý &ß 3ß 3Ý /ß (á�BÓ€óó:<÷Pñ Pñp �$˜dÔ#÷ð ó $ðôD�ô ð0 �T˜4  c¨D¡j°#¸±*Ð&<Ñ =Ñ>Ð>Ñ?€÷ñ ô8�ô ô&�Eô ô<ˆuô ð, —H‘H˜c×/Ñ/°·±Ð@Ð ó#ó*Hó$÷4h'ò h'r'   