File: //home/arjun/projects/env/lib/python3.10/site-packages/coverage/__pycache__/parser.cpython-310.pyc
o
!we� � @ s� d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl Z ddl
mZ ddlm
Z
mZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZ ddlmZ dd lmZm Z dd
l!m"Z"m#Z# ddl$m%Z% ddl&m'Z'm(Z( G d
d� d�Z)G dd� d�Z*G dd� de�+dd��Z,G dd� de�Z-ee'eeee. ee. f f Z/G dd� d�Z0G dd� de0�Z1G dd� de0�Z2G dd� de0�Z3G dd � d e0�Z4G d!d"� d"ej5�Z6d:d'd(�Z7G d)d*� d*�Z8d+gZ9d;d/d0�Z:de;fd<d8d9�Z<dS )=zCode parsing for coverage.py.� )�annotationsN)�CodeType)�cast�Any�Callable�Dict�Iterable�List�Optional�Protocol�Sequence�Set�Tuple)�env)�code_objects)�short_stack)�NoSource� NotPython)�
join_regex� nice_pair)�generate_tokens)�TArc�TLineNoc @ s� e Zd ZdZ d1d2d d
�Zd3dd�Zd4dd�Zd5dd�Zd6dd�Zd7dd�Z d8d d!�Z
d4d"d#�Zd9d$d%�Zd4d&d'�Z
d:d)d*�Z d;d<d/d0�ZdS )=�PythonParserz�Parse code to find executable lines, excluded lines, etc.
This information is all based on static analysis: no code execution is
involved.
N�text�
Optional[str]�filename�exclude�return�Nonec
C s� |s|sJ d��|pd| _ |dur|| _n'ddlm} z|| j �| _W n ty; } ztd| j � d|� ��|�d}~ww || _| j�d�| _t � | _
t � | _t � | _t � | _
t � | _t � | _d | _i | _d| _d| _dS )
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_sourcezNo source for code: 'z': �
F)r r �coverage.pythonr �OSErrorr r �split�lines�set�
statements�excluded�raw_statements�raw_excluded�
raw_classdefs�raw_docstrings�show_tokens�
_multiline� _all_arcs�_missing_arc_fragments)�selfr r r r �err� r3 �H/home/arjun/projects/env/lib/python3.10/site-packages/coverage/parser.py�__init__&