Ë
    oPêj˜  ã                  ó°   — d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl	m
Z
mZ ddlmZ ddlmZ dd	lmZ dd
lmZ erddlmZ  ee«      Z G d„ d«      Zy)z'Source file annotation for coverage.py.é    )ÚannotationsN)ÚTYPE_CHECKING)Úflat_rootname)Ú
ensure_dirÚisolate_module)ÚFileReporter)Úget_analysis_to_report)ÚAnalysis)ÚTMorfs)ÚCoveragec                  ór   — e Zd ZdZdd„Z ej                  d«      Z ej                  d«      Zd	d
d„Z	dd„Z
y)ÚAnnotateReportera  Generate annotated source files showing line coverage.

    This reporter creates annotated copies of the measured source files. Each
    .py file is copied as a .py,cover file, with a left-hand margin annotating
    each line::

        > def h(x):
        -     if 0:   #pragma: no cover
        -         pass
        >     if x == 1:
        !         a = 1
        >     else:
        >         a = 2

        > h(2)

    Executed lines use ">", lines not executed use "!", lines excluded from
    consideration use "-".

    c                óV   — || _         | j                   j                  | _        d | _        y ©N)ÚcoverageÚconfigÚ	directory)Úselfr   s     úV/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/coverage/annotate.pyÚ__init__zAnnotateReporter.__init__1   s!   € Ø ˆŒØ—m‘m×*Ñ*ˆŒØ%)ˆ�ó    z\s*(#|$)z\s*else\s*:\s*(#|$)Nc                ó¦   — || _         | j                  j                  «        t        | j                  |«      D ]  \  }}| j	                  ||«       Œ y)zIRun the report.

        See `coverage.report()` for arguments.

        N)r   r   Úget_datar	   Úannotate_file)r   Úmorfsr   ÚfrÚanalysiss        r   ÚreportzAnnotateReporter.report9   sI   € ð #ˆŒØ�‰×ÑÔ Ü2°4·=±=À%ÓHò 	-‰LˆB�Ø×Ñ˜r 8Õ,ñ	-r   c                ó–  — t        |j                  «      }t        |j                  «      }t        |j                  «      }| j                  r˜t        | j                  «       |j                  «       }t        j                  j                  | j                  t        |«      «      }t        j                  j                  |«      d   }|dt        |«      t        |«      z
   |z   }n|j                  }|dz  }t        |dd¬«      5 }	dx}
}d}|j                  «       }t!        |j#                  d«      d¬	«      D �]{  \  }}|
t        |«      k  r$||
   |k  r|
dz  }
|
t        |«      k  r	||
   |k  rŒ|t        |«      k  r$||   |k  r|dz  }|t        |«      k  r	||   |k  rŒ|
t        |«      k  r ||
   |k(  r|t        |«      k\  xs ||   |kD  }| j$                  j'                  |«      r|	j)                  d
«       n¥| j*                  j'                  |«      rO|t        |«      k\  r|	j)                  d«       nj||
   ||   k(  r|	j)                  d«       nM|	j)                  d«       n;||v r|	j)                  d«       n%|r|	j)                  d«       n|	j)                  d«       |	j)                  |«       �Œ~ 	 ddd«       y# 1 sw Y   yxY w)z]Annotate a single file.

        `fr` is the FileReporter for the file to annotate.

        é   Nz,coverÚwzutf-8)Úencodingr   T)Ústartz  z> z! z- )ÚsortedÚ
statementsÚmissingÚexcludedr   r   Úrelative_filenameÚosÚpathÚjoinr   ÚsplitextÚlenÚfilenameÚopenÚsourceÚ	enumerateÚ
splitlinesÚblank_reÚmatchÚwriteÚelse_re)r   r   r   r%   r&   r'   Ú	rel_fnameÚ	dest_fileÚextÚdestÚiÚjÚcoveredr0   ÚlinenoÚlines                   r   r   zAnnotateReporter.annotate_fileD   sp  € ô ˜H×/Ñ/Ó0ˆ
Ü˜×)Ñ)Ó*ˆÜ˜(×+Ñ+Ó,ˆà�>Š>Ü�t—~‘~Ô&Ø×,Ñ,Ó.ˆIÜŸ™Ÿ™ T§^¡^´]À9Ó5MÓNˆIô —'‘'×"Ñ" 9Ó-¨aÑ0ˆCØ!Ð"=¤C¨	£N´S¸³XÑ$=Ð>ÀÑD‰IàŸ™ˆIØ�XÑˆ	ä�)˜S¨7Ô3ð 	!°tØˆIˆA�ØˆGØ—Y‘Y“[ˆFÜ )¨&×*;Ñ*;¸DÓ*AÈÔ Kó !‘�˜Øœ#˜j›/Ò)¨j¸©m¸fÒ.DØ˜‘F�Að œ#˜j›/Ò)¨j¸©m¸fÓ.Dàœ#˜g›,Ò&¨7°1©:¸Ò+>Ø˜‘F�Að œ#˜g›,Ò&¨7°1©:¸Ó+>à”s˜:“Ò&¨:°a©=¸FÒ+BØ¤3 w£<Ñ/ÒF°7¸1±:ÀÑ3F�GØ—=‘=×&Ñ& tÔ,Ø—J‘J˜tÕ$Ø—\‘\×'Ñ'¨Ô-àœC ›LÒ(ØŸ
™
 4Õ(Ø# A™¨'°!©*Ò4ØŸ
™
 4Õ(àŸ
™
 4Õ(Ø˜xÑ'Ø—J‘J˜tÕ$ÙØ—J‘J˜tÕ$à—J‘J˜tÔ$à—
‘
˜4Ö ñ1!÷		!÷ 	!ñ 	!ús   ÄA+J?Å/1J?Æ!DJ?Ê?K)r   r   ÚreturnÚNoner   )r   r   r   z
str | Noner@   rA   )r   r   r   r
   r@   rA   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚreÚcompiler3   r6   r   r   © r   r   r   r      s9   „ ñó**ð
 ˆr�z‰z˜+Ó&€HØˆb�j‰jÐ/Ó0€Gô	-ô3!r   r   )rE   Ú
__future__r   r)   rF   Útypingr   Úcoverage.filesr   Úcoverage.miscr   r   Úcoverage.pluginr   Úcoverage.report_corer	   Úcoverage.resultsr
   Úcoverage.typesr   r   r   r   rH   r   r   ú<module>rQ      sF   ðñ .õ #ã 	Û 	Ý  å (ß 4Ý (Ý 7Ý %Ý !áÝ!á�BÓ€÷\!ò \!r   