Ë
    oPêjÀ  ã                  óB  — 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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.«      Z0 G d„ de.«      Z1ejd                  ejf                  ejh                  fZ5d'd „Z6d(d!„Z7d)d"„Z8 G d#„ d$«      Z9y)*zCode parsing for coverage.py.é    )ÚannotationsN)ÚCallableÚIterableÚSequence)Ú	dataclass)ÚProtocolÚcast)Úenv)Ú
ByteParser)Úshort_stack)ÚNoSourceÚ	NotPython)Úisolate_moduleÚ	nice_pair)ÚTTokenÚ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	            úT/home/oem/CyberBrain26-unified/.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°¸!±Ó<ò 7�FØ,6�M &Ò)ð7àˆ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 | _        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)Úselfr*   r0   r3   r/   Úerrs         r&   Ú__init__zPythonParser.__init__N   sý   € ñ ‘xÐMÐ!MÓMÐØ Ò, HˆŒØÐØ!ˆD�Iå9ðYÙ-¨d¯m©mÓ<�”	ð ˆŒð *.ˆŒô
 ),«ˆŒô '*£eˆŒô -0«EˆÔô +.«%ˆÔô -0«EˆÔð !ˆÔð 68ˆÔð ,0ˆŒØ<@ˆÔ#Ø:<ˆÔà9;ˆÕøôU ò YÜÐ!6°t·}±}°oÀSÈÈÐNÓOÐUXÐXûðYús   ¨C Ã	C-ÃC(Ã(C-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)   øè ø€ ò Ø12�×"Ñ"×&Ñ& q¨!×,ñùs   ƒ&)r   é   )	r5   Ú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ð	)ð ˆ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*   r0   c              3  ó4   K  — | ]  }|j                   –— Œ y ­wrG   ©r%   )rI   Úds     r&   rK   z*PythonParser._raw_parse.<locals>.<genexpr>
  s   è ø€ Ò!H¨q !§(¥(Ñ!Hùs   ‚)Údefaultéÿÿÿÿ)7r3   r\   r9   r5   r7   r*   Úlistr   r'   r   r;   Úprintr   Útok_namerH   r   r   ÚINDENTÚDEDENTÚOPÚintersectionr   Úaddr   r   r   r   r0   r8   rR   Úfind_statementsÚfirst_linesr4   Úwalk_statement_nodesÚ
isinstanceÚastÚClassDefÚFunctionDefÚAsyncFunctionDefÚModuleÚbodyÚExprÚvalueÚConstantÚstrr:   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¦   s6  € ð �<Š<Ø $× 3Ñ 3°D·L±LÓ AˆDÔÜ × 1Ñ 1Ó2ˆDŒMð ˆàˆàˆ	àˆ
àˆàˆà�y‰yÐ$Ð$Ð$Ü”o d§i¡iÓ0Ó1ˆÜ6°vÓ>ˆÔØAGó -	3Ñ=ˆ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ð[-	3ñ` Ü$¨$¯)©)¸d¿m¹mÔLˆKØ×Ñ×&Ñ& {×'BÑ'BÓ'DÔEà×(Ñ(¨¯©Ó7ˆŒð �~‰~Ð)Ð)Ð)Ü(¨¯©Ó8ó 	bˆ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	br(   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>Ö>¨F�—‘ Õ'Ò>Ð>ùÒ>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_arcs0  s=   € àGK×GZÑGZÐ[_ÓG`×a¹V¸aÀ�—‘ Ó# T§_¡_°QÓ%7Ò8Ó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*   r4   r�   r   Ú
TokenErrorÚIndentationErrorÚSyntaxErrorÚhasattrr%   Úargsr   r0   r7   r:   r8   ro   r6   )r@   rA   r%   ÚignoreÚstartss        r&   Úparse_sourcezPythonParser.parse_source4  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.arcsL  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)r4   ÚAstArcAnalyzerr0   r8   r   Úanalyzer˜   Úwith_jump_fixersr>   r—   r5   r<   r   rm   Úmissing_arc_fragmentsr=   )r@   Úaaar˜   Úl1Úl2Úfl1Úfl2s          r&   r§   zPythonParser._analyze_astX  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        «       }|D ]2  }| j                  j                  ||«      }|€Œ"|j                  |«       Œ4 |S )aj  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): (3, 4), (1, 4): None}.  The
        keys are arcs to adjust.  The values are the arcs to use instead, or
        None if the arc should be removed.

        )r5   r>   rH   rm   )r@   r˜   ÚfixedÚarcÚnew_arcs        r&   r—   zPythonParser.fix_with_jumpss  sK   € ô& “ˆØò 	#ˆCØ×,Ñ,×0Ñ0°°cÓ:ˆGØÑ"Ø—	‘	˜'Õ"ð	#ð ˆr(   c                óö   — 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 |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   )ÚcollectionsÚdefaultdictr|   r˜   r0   r7   )r@   Úexit_countsr¯   r°   s       r&   rº   zPythonParser.exit_counts�  s„   € ô +6×*AÑ*AÄ#Ó*FˆØ—i‘i“kò 	!‰FˆB�Ø˜’6ÐR˜c˜b˜UÐ"BÀ4Ç=Á=À/ÐRÓR�6Ø�T—]‘]Ñ"àØ�T—]‘]Ñ"àØ˜‹O˜qÑ ŒOð	!ð Ð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                  ||fdg«      }| j                  |d   d   |«      }|S )z2Provide an English description of an arc's effect.rÀ   r   r   )r=   rH   r¾   )r@   rX   rY   rÃ   r½   s        r&   Úarc_descriptionzPythonParser.arc_description½  sT   € à×*Ñ*Ð6Ð6Ð6Ø×4Ñ4×8Ñ8¸%À¸ÈÀ~ÓVˆØ×,Ñ,¨^¸AÑ->¸qÑ-AÀ3ÓGˆ
ØÐr(   )NNN)r*   ú
str | Noner0   rÊ   r3   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-   F   sˆ   „ ñð  Ø#Ø"ð	?<àð?<ð ð?<ð ð	?<ð
 
ó?<óBó.pbód	ó?ó'óbó<ó0
óó6ó4ó&ó!ô&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_exits  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   r5   Úbreak_exits)r@   rX   s     r&   rB   zLoopBlock.__init__'  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_exits1  s,   € Øò 	7ˆCÙ�C—J‘J §
¡
¨C¯I©IÕ6ð	7àr(   N)rX   r   rË   rÌ   rñ   )rÑ   rÒ   rÓ   rÔ   rB   ré   rì   rÕ   r(   r&   rõ   rõ   $  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__:  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_exits@  óC   € Øò 	ˆ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_exitsJ  r  r(   N)rX   r   r  r{   rË   rÌ   rñ   )rÑ   rÒ   rÓ   rÔ   rB   rî   rð   rÕ   r(   r&   rþ   rþ   7  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__X  s   € à*ˆÔà&ˆÕr(   c                óz   — | j                   �/|D ]*  } ||j                  | j                   |j                  «       Œ, yrù   )r	  r%   rÛ   rû   s       r&   rî   zTryBlock.process_raise_exits^  s<   € Ø×ÑÐ)Øò C�Ù˜Ÿ
™
 D×$6Ñ$6¸¿	¹	ÕBðCàr(   N)r	  úTLineNo | Noner
  r  rË   rÌ   rñ   )rÑ   rÒ   rÓ   rÔ   rB   rî   rÕ   r(   r&   r  r  U  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   n  sX   è ø€ ð ˆ6€DÙ
Ø�x‰x‹zˆØŠ
Ü×)Ñ)¨$Ó/ò 	#ˆEÜ˜%Ô!1Õ2Ø—‘˜EÕ"ð	#ô ù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 a¨¤Ñ3ù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°Ô)¨!Õ,ÐBˆ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)r0   Ú	root_noderH   r6   Ú	multilineró   r|   ÚosÚgetenvrg   rr   Údumpr5   r˜   r¸   r¹   rf   r­   Úblock_stackÚcurrent_with_startsÚall_with_startsÚwith_entriesÚ
with_exitsÚdebug)r@   r0   r:  r6   r;  r%   Údump_asts          r&   rB   zAstArcAnalyzer.__init__Ä  s	  € ð !ˆŒØ"ˆŒØGQÖR¸V˜9Ÿ=™=¨°Õ8Ò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ê  sy   € ä(¨¯©Ó8ò 	0ˆDÜ˜$¤§¡´#×2FÑ2FÐ GÔHØ×.Ñ.¨tÕ4Ü˜D¤#§,¡,Ô/Ø×+Ñ+¨DÕ1Ü˜D¤#§*¡*Õ-Ø×)Ñ)¨$Õ/ñ	0r(   c                ó  ‡ ‡	— ‰ j                   D �ch c]#  }|d   ‰ j                  v r|‰ j                  vr|’Œ% }}i Š	‰ j                  D ]N  }|D �ch c]  }|d   |k(  sŒ|d   ’Œ }}|sŒ!t        |«      dk(  sJ d|› d|›�«       ‚|j	                  «       ‰	|<   ŒP dˆ	ˆ fd„}i }‰ j
                  D ]  \  }}|‰	v sŒ| ||«      f|||f<   Œ ‰	j                  «       D ]  \  }}||f‰ j
                  vsŒd|||f<   Œ |S c c}w c c}w )a}  Get a dict with data for fixing jumps out of with statements.

        Returns a dict.  The keys are arcs that need adjusting: arcs jumping
        back to the start of a with-statement at the end of its body, and arcs
        from the start of a with-statement to the next statement.  The values
        are the arcs to use instead, or None if the arc should be removed.

        r   r   zExpected one arc, got z with start = c                ór   •— ‰|    }| |f‰j                   v r |‰v r|‰|   }} | |f‰j                   v r|‰v rŒ|S rG   )rC  )rX   ÚnxtÚnextsr@   s     €€r&   Ú
final_nextz3AstArcAnalyzer.with_jump_fixers.<locals>.final_next
  sN   ø€ ð ˜‘,ˆCØ˜#�, $§/¡/Ñ1°c¸U±lØ  %¨¡*�s�ð ˜#�, $§/¡/Ñ1°c¸U²làˆJr(   N)rX   r   rË   r   )r˜   rA  rB  Úlenr  rC  Úitems)
r@   rµ   Ú
with_nextsrX   Ústart_nextsrO  ÚfixersrY   rM  rN  s
   `        @r&   r¬   zAstArcAnalyzer.with_jump_fixersô  sT  ù€ ð —y‘yö
àØ�1‰v˜×-Ñ-Ñ-°#¸T×=NÑ=NÑ2Nò ð
ˆ
ð 
ð
 )+ˆØ×)Ñ)ò 	-ˆEØ-7ÖK c¸3¸q¹6ÀU»?˜3˜q›6ÐKˆKÐKÙØÜ�{Ó# qÒ(Ð`Ð,BÀ;À-ÈÐV[ÐU_Ð*`Ó`Ð(Ø&Ÿ?™?Ó,ˆE�%ŠLð	-ö	ð +-ˆØŸ/™/ò 	@‰JˆC�ð
 ˜Š~Ø(+©Z¸Ó->Ð'?�˜˜U�|Ò$ð	@ð  Ÿ+™+›-ò 	,‰JˆE�3ð �uˆ~ T§_¡_Ò4Ø'+�˜˜s�|Ò$ð	,ð ˆùòM
ùò Ls   ‘(C=ÁDÁD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&   rI  z#AstArcAnalyzer._code_object__Module*  sm   € Ø×"Ñ" 4Ó(ˆØ�9Š9Ø×%Ñ% d§i¡iÓ0ˆEØò O�Ø—‘˜SŸZ™Z¨%¨°·±Ð<MÕNñOð �L‰L˜  Õ'r(   c                ó  — | j                  |«      }| j                  j                  t        ||j                  ¬«      «       | j                  |j                  «      }| j                  |«       | j                  j                  «        y )Nr   )	rV  r?  rÁ   rþ   r  rW  rw   rð   r  )r@   r‹   rX   rç   s       r&   rG  z(AstArcAnalyzer._code_object__FunctionDef4  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&   rH  z%AstArcAnalyzer._code_object__ClassDef;  s^   € Ø×"Ñ" 4Ó(ˆØ×!Ñ! $§)¡)Ó,ˆØò 	UˆCØ�L‰L˜Ÿ™ e V¨S¯Y©Y¸+ÀdÇiÁiÀ]Ð8SÕTñ	U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)	rD  rg   r   r˜   rm   r@  rB  r­   rÁ   rà   s        r&   rè   zAstArcAnalyzer.add_arcA  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.)Úreversedr?  r¨   s    r&   Únearest_blockszAstArcAnalyzer.nearest_blocksS  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_nodeW  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_decoratedn  s8   € à×ÒØ×(Ñ(¨Ñ+×2Ñ2ˆFð ˆð —[‘[ˆFØˆr(   c                ó8   — | j                  |j                  «      S rG   )rV  ry   rJ  s     r&   Ú_line__AssignzAstArcAnalyzer._line__Assignv  s   € Ø×!Ñ! $§*¡*Ó-Ð-r(   c                ó´   — |j                   rA|j                   d   �|j                   d   j                  S |j                  d   j                  S |j                  S ©Nr   )Úkeysr%   r,  rJ  s     r&   Ú_line__DictzAstArcAnalyzer._line__Dict{  sK   € Ø�9Š9Ø�y‰y˜‰|Ð'Ø—y‘y ‘|×*Ñ*Ð*ð —{‘{ 1‘~×,Ñ,Ð,à—;‘;Ðr(   c                ón   — |j                   r| j                  |j                   d   «      S |j                  S rk  )ÚeltsrV  r%   rJ  s     r&   Ú_line__ListzAstArcAnalyzer._line__List‰  s,   € Ø�9Š9Ø×%Ñ% d§i¡i°¡lÓ3Ð3à—;‘;Ðr(   c                 ó   — y)Nr   rÕ   rJ  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.

        )r5   rV  r6   rè   r%   rÛ   rƒ  )r@   rw   Ú
from_startÚprev_startsÚ	body_noder%   Ú
prev_starts          r&   rW  zAstArcAnalyzer.process_bodyÇ  s�   € ð( ÐØÐ!Ü!›e‘à)˜l‘àÐ%Ð%Ð%ð ò 	5ˆIØ×'Ñ'¨	Ó2ˆFØ˜TŸ_™_Ñ,ØØ)ò J�
Ø—‘˜Z×.Ñ.°¸
×8HÑ8HÕIðJàŸ/™/¨)Ó4‰Kð	5ð Ð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ö  ó1   € à×(Ñ(Ó*ò 	ˆ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ü  s1   € à×(Ñ(Ó*ò 	ˆ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  s1   € à×(Ñ(Ó*ò 	ˆEØ×)Ñ)¨%°·±Õ>Ùñ	r(   c                óv   — | j                  |«      }t        |d¬«      }| j                  |h«       t        «       S )Nz*the break on line {lineno} wasn't executed©rÛ   )rV  rÙ   ré   r5   )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   r0   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ì   r5   )r@   r‹   r’  Úcontinue_starts       r&   Ú_handle__Continuez AstArcAnalyzer._handle__Continue9  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  Úiterr?  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ˆàò 	7ˆCØ�L‰L˜Ÿ™ U¨C¯I©IÕ6ð	7à×#Ñ#×'Ñ'Ó)ˆÜ˜(¤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)  r5   rÙ   rW  rw   r¤  )r@   r‹   rX   Úconstant_testr1  rç   r…  s          r&   Ú_handle__IfzAstArcAnalyzer._handle__IfX  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  r5   Úcasesr‚   rè   rÙ   rW  rw   r�   rm   )	r@   r‹   rX   rU   rç   r  Ú
case_startr…  Úhad_wildcards	            r&   Ú_handle__MatchzAstArcAnalyzer._handle__Matchd  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î   r5   )r@   r‹   r’  Úraise_starts       r&   Ú_handle__RaisezAstArcAnalyzer._handle__Raise{  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ð   r5   )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  r?  rÁ   rW  rw   rÙ   r	  r  r5   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)  r?  rÁ   rõ   rÙ   rW  rw   rè   r%   rÛ   r5   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ˆØò 	8ˆCØ�L‰L˜Ÿ™ V¨S¯Y©YÕ7ð	8ä“ˆØ×#Ñ#×'Ñ'Ó)ˆÜ˜(¤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_ctxmgrrQ  rV  Úcontext_exprr@  rm   rA  rW  rw   rÙ   Úremoverè   r%   rC  )r@   r‹   Úitemr¤   rX   rç   Ú	with_exitrü   s           r&   Ú_handle__WithzAstArcAnalyzer._handle__WithØ  s  € Ü�>‰>×2Ò2ØHLÏ
É
ÖSÀ�d×(Ñ(¨×):Ñ):Õ;ÐSˆFÑSà×(Ñ(¨Ó.Ð/ˆFØò 	,ˆEØ×$Ñ$×(Ñ(¨Ô/Ø× Ñ ×$Ñ$ UÕ+ð	,ð ×!Ñ! $§)¡)¼ÀÈÁÓ8LÐ!ÓMˆà�r‘
ˆØ× Ñ ×'Ñ'¨Ô.Ü˜e“_Ð%ˆ	ÙØò 9�Ø—‘˜SŸZ™Z¨Ô/Ø—‘×#Ñ# S§Z¡Z°Ð$7Õ8ð9ð ˆEàˆùò% Ts   ©"E)
r0   r{   r:  úast.ASTr6   rÍ   r;  údict[TLineNo, TLineNo]rË   rÌ   rÎ   )rË   zdict[TArc, TArc | None])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¬   rI  rG  rH  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ó/ól(óóUð )-Ø!%ð]àð]ð ð]ð &ð	]ð
 ð]ð 
ó]ó$*ó.ó.ó.ð &€Oó	ð )ÐØ-Ðóóñ ð	
ó€Mó "ðN '+Ø,0ð	%àð%ð $ð%ð *ð	%ð
 
ó%ó^óóóó"ó ð0 *Ðóóð( %Ðà,ÐØ 1Ðó
óó.óó5ðn $Ðóó,ð, 'Ñr(   rª   )r   zIterable[TToken]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]):rÔ   Ú
__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   r   Ú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ß 7ß (á�BÓ€óó:<÷|ñ |ñH �$˜dÔ#÷ð ó $ðôD�ô ð0 �T˜4  c¨D¡j°#¸±*Ð&<Ñ =Ñ>Ð>Ñ?€÷ñ ô8�ô ô&�Eô ô<ˆuô ð, —H‘H˜c×/Ñ/°·±Ð@Ð ó#ó*Hó$÷4'ò 'r(   