ó
    ÷Þ jÒ  ã                  ó¦  • S r SSKJr  SSKrSSKJrJr  SSKJr  SSK	J
r
JrJr   " S S5      rSS	 jrSS
 jr\" SSS5      r\" SS5      r\R$                  R'                  SS5      r\R$                  S   r\" \R.                  5      \" \R0                  5      -  r\ V s1 sH  n S\R4                  U    ;   d  M  U iM     sn r " S S5      rgs  sn f )z!Bytecode analysis for coverage.pyé    )ÚannotationsN)ÚIterableÚMapping)ÚCodeType)ÚTArcÚTLineNoÚTOffsetc                  ód   • \ rS rSrSrSSSS.       SS jjrSS jrSS jrSS jrSS	 jr	S
r
g)Ú
ByteParseré   z3Parse bytecode to understand the structure of code.N)ÚcodeÚtextÚfilenamec               óH   • Uc  Uc   e[        X#=(       d    SSSS9nXl        g )Nz<string>ÚexecT)Údont_inherit)Úcompiler   )Úselfr   r   r   s       ÚK/var/www/html/gaurav/venv/lib/python3.13/site-packages/coverage/bytecode.pyÚ__init__ÚByteParser.__init__   s-   € ð ‰<ØÑ#Ð#Ð#Ü˜4×!7¨Z¸ÈdÑSˆDØ�	ó    c                ó0   • S U R                  5        5       $ )aL  Iterate over all the code objects nested within this one.

The iteration includes `self` as its first value.

We skip code objects named `__annotate__` since they are deferred
annotations that usually are never run.  If there are errors in the
annotations, they will be caught by type checkers or other tools that
use annotations.

c              3  óT   #   • U H  oR                   S :w  d  M  [        US9v •  M!     g7f)Ú__annotate__©r   N)Úco_namer   )Ú.0Úcs     r   Ú	<genexpr>Ú,ByteParser._child_parsers.<locals>.<genexpr>)   s$   é € Ð_Ñ,? qÇ9Á9ÐP^ÑC^Ó"”
 Ö"Ò,?ùs   ‚(˜()Úcode_objects)r   s    r   Ú_child_parsersÚByteParser._child_parsers   s   € ñ `¨D×,=Ñ,=Ô,?Ó_Ð_r   c              #  óæ   #   • U R                   /nU(       aY  UR                  5       nUR                   H+  n[        U[        5      (       d  M  UR                  U5        M-     Uv •  U(       a  MX  gg7f)z,Iterate over all the code objects in `code`.N)r   ÚpopÚ	co_constsÚ
isinstancer   Úappend)r   Ústackr   r   s       r   r"   ÚByteParser.code_objects+   sT   é € à—‘�ˆÞð —9‘9“;ˆDØ—^”^�Ü˜a¤×*Ó*Ø—L‘L –Oñ $ð ŠJ÷ Šeùs   ‚AA1Á A1Á/A1c              #  ón   #   • U R                   R                  5        H  u    pU(       d  M  Uv •  M     g7f)ziYield the line numbers possible in this code object.

Uses co_lines() to produce a sequence: l0, l1, ...
N)r   Úco_lines)r   Ú_Úlines      r   Ú_line_numbersÚByteParser._line_numbers7   s,   é € ð
 Ÿ)™)×,Ñ,Ö.‰JˆAˆqßˆtØ”
ò /ùs   ‚&5¬	5c              #  ón   #   • U R                  5        H  nUR                  5        Sh  v•N   M     g N	7f)zœFind the statements in `self.code`.

Produce a sequence of line numbers that start statements.  Recurses
into all code objects reachable from `self.code`.

N)r#   r0   )r   Úbps     r   Úfind_statementsÚByteParser.find_statements@   s/   é € ð ×%Ñ%Ö'ˆBà×'Ñ'Ó)×)Ò)ò (á)ùs   ‚'5©3ª
5r   )r   zCodeType | Noner   ú
str | Noner   r6   ÚreturnÚNone)r7   zIterable[ByteParser])r7   zIterable[CodeType])r7   zIterable[TLineNo])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r#   r"   r0   r4   Ú__static_attributes__© r   r   r   r      sR   † Ù=ð
 !%ØØ#ñ
ð ð
ð ð	
ð
 ð
ð 
õ
ô`ô
ô÷	*r   r   c                óv   • 0 nU R                  5        H"  u  p#nUc  M  [        X#S5       H  nXAU'   M	     M$     U$ )z6Make a dict mapping byte code offsets to line numbers.é   )r-   Úrange)r   Úb2lÚbstartÚbendÚlinenoÚboffsets         r   Úbytes_to_linesrH   L   sA   € à
€CØ $§¡¦Ñˆ�fØÓÜ  ¨qÖ1�Ø%�G“ó 2ñ !0ð €Jr   c                 ó¤   • U  Vs1 sH-  n[         R                  R                  U5      =n(       d  M+  UiM/     nnU(       d
   SU  35       eU$ s  snf )zwMake a set of opcodes from instruction names.

The names might not exist in this version of Python, skip those if not.
z At least one opcode must exist: )ÚdisÚopmapÚget)Úop_namesÚnameÚopÚopss       r   Úop_setrQ   V   sO   € ñ
 #Ó
B™(�$¬S¯Y©Y¯]©]¸4Ó-@Ð'@ rÓ'@�2™(€CÐ
BÞÐ=Ð2°8°*Ð=Ó=ˆ3Ø€Jùò Cs
   …)A²AÚJUMP_BACKWARDÚJUMP_BACKWARD_NO_INTERRUPTÚJUMP_FORWARDÚRETURN_VALUEÚRETURN_GENERATORÚCACHEéÿÿÿÿÚEXTENDED_ARGc                  óF   • \ rS rSrSr        SS jrS	S jrS
S jrSrg)ÚBranchArcResolveréz   a  Resolve branch events to line arcs, one (source, dest) pair at a time.

Branch events are one-shot (they are DISABLEd after firing), so each
(source offset, destination offset) pair is resolved at most a couple of
times per code object.  Resolving pairs on demand is much cheaper than
precomputing trails for every branch in the code object, most of which
never fire.  We walk the raw bytecode bytes so that we never need to
disassemble whole code objects with `dis`.

To resolve one pair:
starting from the destination, follow the trail of instructions (through
unconditional jumps) until we reach an instruction on a new source line
(giving us the arc), a return (an arc to leaving the code object), or
another branch possibility (no arc: that branch will produce its own
events).

c                óJ   • Xl         UR                  U l        X l        X0l        g )N)r   Úco_codeÚbyte_to_lineÚmultiline_map)r   r   r_   r`   s       r   r   ÚBranchArcResolver.__init__�   s    € ð Œ	à—|‘|ˆŒØ(ÔØ*Õr   c                óx   • U R                   R                  U5      nUb  U R                  R                  X"5      nU$ )z>The source line of the instruction at `offset`, de-multilined.)r_   rL   r`   )r   Úoffsetr/   s      r   Úline_atÚBranchArcResolver.line_at™   s9   € à× Ñ ×$Ñ$ VÓ,ˆØÑØ×%Ñ%×)Ñ)¨$Ó5ˆDØˆr   c                ó   • U R                  U5      nUc  gU R                  n[        U5      nU R                  nU R                  nUnSn	[        5       n
SUs=::  a  U:  Ga.  O  gXŠ;  Ga%  U
R                  U5        XH   nU[        :X  a  US-  nM=  U[        :X  a  X”US-      -  S-  n	US-  nM[  UR                  U5      nUb   UR                  XÌ5      nU(       a  XÃ:w  a  X<4$ U[        ;   ab  U[        ;   aW  X”US-      -  nUS-   nXå:  a$  XN   [        :X  a  US-  nXå:  a  XN   [        :X  a  M  U[        ;   a	  USU-  -
  nOUSU-  -   nSn	Mú  gU[        ;   a  X0R                  R                  * 4$ Sn	US-  nSUs=::  a  U:  a  O  gXŠ;  a  GM%  g)zBTurn a branch event's (source, dest) offsets into an arc, or None.Nr   rA   é   é   )rd   r^   Úlenr_   r`   ÚsetÚaddÚ_CACHEÚ_EXTENDED_ARGrL   ÚJUMPSÚALWAYS_JUMPSÚBACKWARD_JUMPSÚRETURNSr   Úco_firstlineno)r   ÚsourceÚdestÚ	from_liner^   Ú
max_offsetr_   r`   rc   Úext_argÚseenrO   r/   ÚargÚnext_offsets                  r   ÚresolveÚBranchArcResolver.resolve    sË  € à—L‘L Ó(ˆ	ØÑØØ—,‘,ˆÜ˜“\ˆ
Ø×(Ñ(ˆØ×*Ñ*ˆØˆØˆÜ ›UˆØ�6Õ&˜JÖ&ðH ðI ,2Ô+=Ø�H‰H�VÔØ‘ˆBØ”V‹|Ø˜!‘�ÙØ”]Ó"Ø"¨V°a©ZÑ%8Ñ8¸QÑ>�Ø˜!‘�ÙØ×#Ñ# FÓ+ˆDØÑØ$×(Ñ(¨Ó4�Þ˜DÓ-Ø%Ð,Ð,Ø”U‹{ØœÓ%Ø!¨F°Q©JÑ$7Ñ7�Cð #)¨1¡*�KØ%Ó2°wÑ7KÌvÓ7UØ# qÑ(˜ð &Ó2°wÑ7KÌvÕ7Uàœ^Ó+Ø!,¨q°3©wÑ!6™à!,¨q°3©wÑ!6˜Ø�GÙàØ”W‹}Ø!§I¡I×$<Ñ$<Ð#<Ð=Ð=ØˆGØ�a‰KˆFðG �6Õ&˜JÕ&ðH ðI ,2Ö+=ðH r   )r_   r^   r   r`   N)r   r   r_   zMapping[TOffset, TLineNo]r`   zMapping[TLineNo, TLineNo]r7   r8   )rc   r	   r7   zTLineNo | None)rs   r	   rt   r	   r7   zTArc | None)	r9   r:   r;   r<   r=   r   rd   r{   r>   r?   r   r   r[   r[   z   s<   † ñð$
+àð
+ð 0ð
+ð 1ð	
+ð
 
ô
+ô÷0r   r[   )r   r   r7   zdict[TOffset, TLineNo])rM   Ústrr7   zset[int])r=   Ú
__future__r   rJ   Úcollections.abcr   r   Útypesr   Úcoverage.typesr   r   r	   r   rH   rQ   ro   rq   rK   rL   rl   rm   rj   ÚhasjrelÚhasjabsrn   Úopnamerp   r[   )rO   s   0r   Ú<module>r…      sÑ   ðñ (å "ã 
ß -Ý ç 1Ñ 1÷:*ñ :*ôzôñ ØØ Øó€ñ ØØó€ð 
�‰�‰�w Ó	#€Ø—	‘	˜.Ñ)€ñ 	ˆC�K‰KÓ™3˜sŸ{™{Ó+Ñ+€ñ  %ÓJ™u˜¨¸3¿:¹:Àb¹>Ñ(I—"™uÑJ€÷Vò Vùò Ks   Â CÂ:C