Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/coverage/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/coverage/__pycache__/parser.cpython-37.pyc

B

E�Wq��@sVdZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddl	mZmZddl
mZddlmZddlmZmZmZmZdd	lmZmZmZdd
lmZmZmZGdd�de�ZGd
d�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd�de�#dd��Z$eddd��Gdd�de�Z%dgZ&dd �Z'd#d!d"�Z(dS)$zCode parsing for coverage.py.�N)�env)�range)�
bytes_to_ints�string_class)�CodeObjects)�short_stack)�contract�new_contract�	nice_pair�
join_regex)�CoverageException�NoSource�	NotPython)�compile_unicode�generate_tokens�neuter_encoding_declarationc@s�eZdZdZedd�ddd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd dd�ZdS)!�PythonParserz�Parse code to find executable lines, excluded lines, etc.

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

    zunicode|None)�textNc
Cs�|s|std��|pd|_||_|jsxddlm}y||j�|_Wn4tk
rv}ztd|j|f��Wdd}~XYnX||_|j�d�|_	t
�|_t
�|_t
�|_
t
�|_t
�|_t
�|_d|_i|_d|_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.

        z*PythonParser needs either text or filenamez<code>r)�get_python_sourcezNo source for code: '%s': %sN�
F)�AssertionError�filenamerZcoverage.pythonr�IOErrorr
�exclude�split�lines�set�
statements�excluded�raw_statements�raw_excluded�
raw_classdefs�raw_docstrings�show_tokens�
_multiline�_byte_parser�	_all_arcs�_missing_arc_fragments)�selfrrrr�err�r*�B/opt/alt/python37/lib64/python3.7/site-packages/coverage/parser.py�__init__s.
"zPythonParser.__init__cCs|jst|j|jd�|_|jS)zCreate a ByteParser on demand.)r)r%�
ByteParserrr)r(r*r*r+�byte_parser\szPythonParser.byte_parsercGs\t|�}tjr|�d�}t�|�}t�}x.t|jdd�D]\}}|�	|�r8|�
|�q8W|S)z�Find the lines matching one of a list of regexes.

        Returns a set of line numbers, the lines that contain a match for one
        of the regexes in `regexes`.  The entire line needn't match, just a
        part of it.

        �utf8�)�start)rr�PY2�decode�re�compiler�	enumerater�search�add)r(ZregexesZcombinedZregex_c�matches�i�ltextr*r*r+�lines_matchingcs


zPythonParser.lines_matchingcCsH|jr|�|j�|_d}d}d}d}tj}d}d}d}t|j�}	�x�|	D�]�\}
}\}}
\}}
}|jr�tdt	j
�|
|
�t||f�||f�|
tjkr�|d7}�n0|
tj
kr�|d8}�n|
tjkr�|dkr�|j�|�n�|
tjk�rV|dk�r"||jkp�|}|�sT|�rT|j�|�|}d}d}n2|d	k�r�|�r�||jk�rBd}|�r�|j�|�n||
tjk�r�|tjk�r�|j�t||d��nL|
tjk�r�|dk	�r�||k�r�x"t||d�D]}||j|<�q�Wd}d}|���r$|
t	jk�r$d}|dk�r$|}|�r||k�rd}|�r |j�|�d}|
}qHW|�sD|j�|j���dS)
zwParse the source to find the interesting facts about its lines.

        A handful of attributes are updated.

        rFNTz%10s %5s %-20r %rr0�class�:�@)rr<r �token�INDENTrrr#�print�tokenize�tok_name�getr
�DEDENT�NAMEr!r8�OP�STRINGr"�updater�NEWLINEr$�strip�COMMENTrr.�_find_statements)r(�indentZexclude_indentZ	excludingZexcluding_decoratorsZprev_toktype�
first_line�emptyZ
first_on_lineZtokgenZtoktypeZttextZslineno�_Zelinenor;Zshould_exclude�lr*r*r+�
_raw_parsevsp
 




zPythonParser._raw_parsecCs|j�||�S)z?Return the first line number of the statement including `line`.)r$rE)r(�liner*r*r+rP�szPythonParser.first_linecst�fdd�|D��S)z�Map the line numbers in `lines` to the correct first line of the
        statement.

        Returns a set of the first lines.

        c3s|]}��|�VqdS)N)rP)�.0rS)r(r*r+�	<genexpr>�sz+PythonParser.first_lines.<locals>.<genexpr>)r)r(rr*)r(r+�first_lines�szPythonParser.first_linescCs
|�|�S)z)Implement `FileReporter.translate_lines`.)rX)r(rr*r*r+�translate_lines�szPythonParser.translate_linescs�fdd�|D�S)z(Implement `FileReporter.translate_arcs`.cs$g|]\}}��|���|�f�qSr*)rP)rV�a�b)r(r*r+�
<listcomp>�sz/PythonParser.translate_arcs.<locals>.<listcomp>r*)r(�arcsr*)r(r+�translate_arcs�szPythonParser.translate_arcsc
Cs�y|��Wnbtjtfk
rn}z>t|d�r6|j}n|jdd}td|j|jd|f��Wdd}~XYnX|�	|j
�|_|j|jB}|j
|}|�	|�||_dS)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.

        �linenor0rz5Couldn't parse '%s' as Python source: '%s' at line %dN)rTrC�
TokenError�IndentationError�hasattrr_�argsrrrXr rr"rr)r(r)r_�ignore�startsr*r*r+�parse_source�s
(
zPythonParser.parse_sourcecCs|jdkr|��|jS)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.

        N)r&�_analyze_ast)r(r*r*r+r]s
zPythonParser.arcscCsnt|j|j|j�}|��t�|_x>|jD]4\}}|�|�}|�|�}||kr*|j�	||f�q*W|j
|_dS)zkRun the AstArcAnalyzer and save its results.

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

        N)�AstArcAnalyzerrrr$�analyzerr&r]rPr8�missing_arc_fragmentsr')r(Zaaa�l1�l2Zfl1Zfl2r*r*r+rgs

zPythonParser._analyze_astcCs~t�t�}xF|��D]:\}}|dkr&q||jkr2q||jkr>q||d7<qWx&|jD]}||krZ||d8<qZW|S)zYGet a count of exits from that each line.

        Excluded lines are excluded.

        rr0)�collections�defaultdict�intr]rr!)r(�exit_countsrkrlrSr*r*r+rps


zPythonParser.exit_countscCs|jdkr|��|}|rP|dkrP||krP||f|krP||f|jkrP||}}|j�||fdg�}g}x�|D]�}|\}}	|	dkr�|dkr�||f|jkr�|�||�Sd}	nd}	|	j|d�}	dj||	d�}
|dk	r�|
d	j|j|d�d
�7}
|�|
�qnWd�|�S)z5Provide an English sentence describing a missing arc.Nr)NNz didn't jump to the function exitzdidn't jump to line {lineno})r_zline {start} {emsg})r1�emsgz, because {smsg})�smsgz or )r'rgrE�missing_arc_description�format�append�join)r(r1�endZ
executed_arcsZactual_startZfragment_pairsZmsgsZ
fragment_pairrrrq�msgr*r*r+rs8s0


z$PythonParser.missing_arc_description)NNN)N)�__name__�
__module__�__qualname__�__doc__rr,�propertyr.r<rTrPrXrYr^rfr]rgrprsr*r*r*r+rs=[	rc@s<eZdZdZedd�d
dd��Zdd�Zd	d
�Zdd�ZdS)r-z3Parse bytecode to understand the structure of code.�unicode)rNc
Cs�||_|r||_nLyt||d�|_Wn8tk
r\}ztd||j|jf��Wdd}~XYnXx dD]}t|j|�sdtd��qdWdS)N�execz5Couldn't parse '%s' as Python source: '%s' at line %d)�	co_lnotab�co_firstlineno�	co_constszlThis implementation of Python doesn't support code analysis.
Run coverage.py under CPython for this command.)	r�coder�SyntaxErrorrrxr_rbr)r(rr�rZsynerr�attrr*r*r+r,es$
zByteParser.__init__cst�j�}�fdd�|D�S)z~Iterate over all the code objects nested within this one.

        The iteration includes `self` as its first value.

        c3s|]}t�j|d�VqdS))r�N)r-r)rV�c)r(r*r+rW�sz+ByteParser.child_parsers.<locals>.<genexpr>)rr�)r(�childrenr*)r(r+�
child_parsers}s
zByteParser.child_parsersccs�t|jjddd��}t|jjddd��}d}|jj}d}x@t||�D]2\}}|rr||krj||fV|}||7}||7}qHW||kr�||fVdS)a&Map byte offsets to line numbers in `code`.

        Uses co_lnotab described in Python/compile.c to map byte offsets to
        line numbers.  Produces a sequence: (b0, l0), (b1, l1), ...

        Only byte offsets that correspond to line numbers are included in the
        results.

        rN�r0)rr�r�r��zip)r(�byte_increments�line_incrementsZ
last_line_numZline_numZbyte_num�	byte_incr�	line_incrr*r*r+�_bytes_lines�s
zByteParser._bytes_linesccs2x,|��D] }x|��D]\}}|VqWq
WdS)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�r�)r(ZbprRrSr*r*r+rN�szByteParser._find_statements)NN)	ryrzr{r|rr,r�r�rNr*r*r*r+r-bs	r-c@seZdZdZdd�ZdS)�	LoopBlockz@A block on the block stack representing a `for` or `while` loop.cCs||_t�|_dS)N)r1r�break_exits)r(r1r*r*r+r,�szLoopBlock.__init__N)ryrzr{r|r,r*r*r*r+r��sr�c@seZdZdZdd�ZdS)�
FunctionBlockz>A block on the block stack representing a function definition.cCs||_||_dS)N)r1�name)r(r1r�r*r*r+r,�szFunctionBlock.__init__N)ryrzr{r|r,r*r*r*r+r��sr�c@seZdZdZddd�ZdS)�TryBlockz6A block on the block stack representing a `try` block.NcCs0||_||_t�|_t�|_t�|_t�|_dS)N)�
handler_start�final_startr�
break_from�
continue_from�return_from�
raise_from)r(r�r�r*r*r+r,�szTryBlock.__init__)NN)ryrzr{r|r,r*r*r*r+r��sr�cs"eZdZdZd�fdd�	Z�ZS)�ArcStartz�The information needed to start an arc.

    `lineno` is the line number the arc starts from.  `cause` is a fragment
    used as the startmsg for AstArcAnalyzer.missing_arc_fragments.

    Ncstt|��|||�S)N)�superr��__new__)�clsr_�cause)�	__class__r*r+r��szArcStart.__new__)N)ryrzr{r|r��
__classcell__r*r*)r�r+r��sr�ZArcz
lineno, cause�	ArcStartscCstdd�|D��S)Ncss|]}t|t�VqdS)N)�
isinstancer�)rV�xr*r*r+rW�sz<lambda>.<locals>.<genexpr>)�all)�seqr*r*r+�<lambda>��r�c
@sNeZdZdZeded�dd��Zdd�Zd[d	d
�Zdd�Z	ee
d
�dd��Zdd�Zdd�Z
dd�Zdd�Zeddddddddd d!d"d#g�Zed$d
�d%d&��Zed$d
�d\d'd(��Zd)d*�Zed$d+�d,d-��Zed$d+�d.d/��Zed$d+�d0d1��Zed$d+�d2d3��Zed$d
�d4d5��Zed$d
�d6d7��ZeZed$d
�d8d9��Zed$d
�d:d;��ZeZeZeZed$d
�d<d=��Z ed$d
�d>d?��Z!ed$d
�d@dA��Z"ed$d
�dBdC��Z#dDdE�Z$ed$d
�dFdG��Z%ed$d
�dHdI��Z&ed$d
�dJdK��Z'ed$d
�dLdM��Z(e(Z)dNdO�Z*dPdQ�Z+e+Z,dRdS�Z-dTdU�Z.e.dV�Z/e.dW�Z0e.dX�Z1e.dY�Z2e3j4�rJe.dZ�Z5dS)]rhz>Analyze source text with an AST to find executable code paths.r~)rrcs�t�t|��|_t�fdd�|D��|_�|_ttj	�
dd��rjtd�|j��td�|j��t
|j�t�|_t�t�|_g|_tttj	�
dd���|_dS)Nc3s|]}��||�VqdS)N)rE)rVrS)�	multiliner*r+rW�sz*AstArcAnalyzer.__init__.<locals>.<genexpr>ZCOVERAGE_ASTDUMPrzStatements: {}zMultiline map: {}ZCOVERAGE_TRACK_ARCS)�ast�parser�	root_noderrr�ro�os�environrErBrt�ast_dumpr]rmrn�listrj�block_stack�bool�debug)r(rrr�r*)r�r+r,�s
zAstArcAnalyzer.__init__cCsBx<t�|j�D],}|jj}t|d|d�}|dk	r||�qWdS)z�Examine the AST tree from `root_node` to determine possible arcs.

        This sets the `arcs` attribute to be a set of (from, to) line number
        pairs.

        Z_code_object__N)r��walkr�r�ry�getattr)r(�node�	node_nameZcode_object_handlerr*r*r+ri�s
zAstArcAnalyzer.analyzeNcCsd|jr(td�||||��ttdd��|j�||f�|dk	sH|dk	r`|j||f�||f�dS)z@Add an arc, including message fragments to use if it is missing.z!
Adding arc: ({}, {}): {!r}, {!r}�)�limitN)r�rBrtrr]r8rjru)r(r1rwrrrqr*r*r+�add_arcszAstArcAnalyzer.add_arccCs
t|j�S)z.Yield the blocks in nearest-to-farthest order.)�reversedr�)r(r*r*r+�nearest_blocksszAstArcAnalyzer.nearest_blocks)ZreturnscCs2|jj}t|d|d�}|dk	r(||�S|jSdS)z}What is the right line number to use for this node?

        This dispatches to _line__Node functions where needed.

        Z_line__N)r�ryr�r_)r(r�r��handlerr*r*r+�
line_for_nodes
zAstArcAnalyzer.line_for_nodecCs|�|j�S)N)r��value)r(r�r*r*r+�
_line__AssignszAstArcAnalyzer._line__AssigncCsBtjdkr8|jr8|jddk	r*|jdjS|jdjSn|jSdS)N)��r)rZ	PYVERSION�keysr_�values)r(r�r*r*r+�_line__Dict!s
zAstArcAnalyzer._line__DictcCs |jr|�|jd�S|jSdS)Nr)�eltsr�r_)r(r�r*r*r+�_line__List-szAstArcAnalyzer._line__ListcCs|jr|�|jd�SdSdS)Nrr0)�bodyr�)r(r�r*r*r+�
_line__Module3szAstArcAnalyzer._line__Module�Assign�Assert�	AugAssign�DeleteZExec�Expr�Global�Import�
ImportFrom�Nonlocal�PassZPrintr�cCs@|jj}t|d|d�}|dk	r(||�Stt|�|�dd�g�S)zhAdd the arcs for `node`.

        Return a set of ArcStarts, exits from this node to the next.

        Z	_handle__N)r�)r�ryr�rr�r�)r(r�r�r�r*r*r+�add_arcs?s
zAstArcAnalyzer.add_arcscCsr|dkrt|g�}xZ|D]R}|�|�}|j�||�}||jkr@qx|D]}|�|j||j�qFW|�|�}qW|S)auAdd arcs for the body of a compound statement.

        `body` is the body node.  `from_start` is a single `ArcStart` that can
        be the previous line in flow before this body.  `prev_starts` is a set
        of ArcStarts that can be the previous line.  Only one of them should be
        given.

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

        N)	rr�r�rErr�r_r�r�)r(r��
from_start�prev_startsZ	body_noder_rPZ
prev_startr*r*r+�
add_body_arcsQs




zAstArcAnalyzer.add_body_arcscCs4|jj}|dkrdS|dkr0tjr0|jdkr0dSdS)z Is this a compile-time constant?)�NameConstant�NumT�Name)�True�False�NoneF)r�ryr�PY3�id)r(r�r�r*r*r+�is_constant_expriszAstArcAnalyzer.is_constant_expr)�exitscCsRxL|��D]@}t|t�r(|j�|�Pq
t|t�r
|jdk	r
|j�|�Pq
WdS)z0Add arcs due to jumps from `exits` being breaks.N)r�r�r�r�rJr�r�r�)r(r��blockr*r*r+�process_break_exitszs
z"AstArcAnalyzer.process_break_exitscCshxb|��D]V}t|t�r>x |D]}|�|j|j|j�qWPq
t|t�r
|jdk	r
|j	�
|�Pq
WdS)z3Add arcs due to jumps from `exits` being continues.N)r�r�r�r�r_r1r�r�r�r�rJ)r(r�r��xitr*r*r+�process_continue_exits�s

z%AstArcAnalyzer.process_continue_exitsc
Cs�x�|��D]�}t|t�rb|jdk	rHx |D]}|�|j|j|j�q(WPq�|jdk	r�|j�	|�Pq
t|t
�r
x,|D]$}|�|j|j|jd�|j
��qrWPq
WdS)z0Add arcs due to jumps from `exits` being raises.Nz!didn't except from function '{0}')r�r�r�r�r�r_r�r�r�rJr�r1rtr�)r(r�r�r�r*r*r+�process_raise_exits�s





z"AstArcAnalyzer.process_raise_exitsc
Cstxn|��D]b}t|t�r2|jdk	r2|j�|�Pq
t|t�r
x,|D]$}|�|j|j	|j
d�|j��qBWPq
WdS)z1Add arcs due to jumps from `exits` being returns.Nz!didn't return from function '{0}')
r�r�r�r�r�rJr�r�r_r1r�rtr�)r(r�r�r�r*r*r+�process_return_exits�s

z#AstArcAnalyzer.process_return_exitscCs(|�|�}t|dd�}|�|g�t�S)Nz*the break on line {lineno} wasn't executed)r�)r�r�r�r)r(r��hereZbreak_startr*r*r+�_handle__Break�s
zAstArcAnalyzer._handle__BreakcCs�|�|�}|jr�x0|jD]&}|�|�}||kr|�||�|}qW|�|jd�}|j�||�}x0t|d|�D]}||jkrp|�||�|}qpWtt	|dd�g�S)zBAdd arcs for things that can be decorated (classes and functions).rr0N)r�)
r�Zdecorator_listr�r�r�rErrrr�)r(r��lastZdec_nodeZ	dec_startZ
body_startr_r*r*r+�_handle_decorated�s


z AstArcAnalyzer._handle_decoratedcCs(|�|�}t|dd�}|�|g�t�S)Nz-the continue on line {lineno} wasn't executed)r�)r�r�r�r)r(r�r�Zcontinue_startr*r*r+�_handle__Continue�s
z AstArcAnalyzer._handle__ContinuecCs�|�|j�}|j�t|d��t|dd�}|j|j|d�}x|D]}|�|j	||j
�q@W|j��}|j}t|dd�}|j
r�|j|j
|d�}||O}n
|�|�|S)N)r1z'the loop on line {lineno} never started)r�)r�z)the loop on line {lineno} didn't complete)r��iterr�rur�r�r�r�r�r_r��popr��orelser8)r(r�r1r�r�r��my_block�
else_exitsr*r*r+�_handle__For�s



zAstArcAnalyzer._handle__ForcCsL|�|j�}t|dd�}|j|j|d�}t|dd�}||j|j|d�O}|S)Nz-the condition on line {lineno} was never true)r�)r�z.the condition on line {lineno} was never false)r��testr�r�r�r�)r(r�r1r�r�r*r*r+�_handle__If�szAstArcAnalyzer._handle__IfcCs(|�|�}t|dd�}|�|g�t�S)Nz*the raise on line {lineno} wasn't executed)r�)r�r�r�r)r(r�r�Zraise_startr*r*r+�_handle__Raise�s
zAstArcAnalyzer._handle__RaisecCs(|�|�}t|dd�}|�|g�t�S)Nz+the return on line {lineno} wasn't executed)r�)r�r�r�r)r(r�r�Zreturn_startr*r*r+�_handle__Returns
zAstArcAnalyzer._handle__ReturncCs�|jr|�|jd�}nd}|jr4|�|jd�}nd}t||d�}|j�|�|�|�}|j|jt|dd�d�}|jr�d|_	|jr�t
g�|_n
|j��t
�}|j�rd}xT|jD]J}	|�|	�}|dk	r�|�
||�|}d}
t||
d�}||j|	j|d�O}q�W|j�r|j|j|d�}||O}|j�r�|j��||jB|jB|jB|jB}|j|j|d�}|j�r�|�|j|�}
|�|
�|j�r�|�|j|�}|�|�|j�r�|�|j|�}|�|�|j�r�|�|j|�}|�|�|S)Nr)r�r�)r�)r�z3the exception caught by line {lineno} didn't happen)r�)�handlersr��	finalbodyr�r�rur�r�r�r�rr�r�r�r�r�r�r��_combine_finally_startsr�r�r�r�)r(r�r�r�Z	try_blockr1r�Z
handler_exitsZlast_handler_startZhandler_nodeZ
from_causer�Z
final_fromr�Zcontinue_exitsZraise_exitsZreturn_exitsr*r*r+�_handle__Trys^







zAstArcAnalyzer._handle__TrycsXg}x.t|�D]"\}��dk	r|��j|d��qWd�|��t�fdd�|D��}|S)z4Helper for building the cause of `finally` branches.N)r_z or c3s|]}t|j��VqdS)N)r�r_)rV�ex)r�r*r+rWasz9AstArcAnalyzer._combine_finally_starts.<locals>.<genexpr>)�sortedrurtrvr)r(rer�Zcausesr_r*)r�r+r�Zs
z&AstArcAnalyzer._combine_finally_startscCsg|_|�|�S)N)r�r�)r(r�r*r*r+�_handle__TryExceptdsz!AstArcAnalyzer._handle__TryExceptcCsbg|_g|_|jd}|jjdkrX|j|jkrXt|j�dks@t�|j|_|j|_|j|_|�|�S)NrZ	TryExceptr0)	r�r�r�r�ryr_�lenrr�)r(r��firstr*r*r+�_handle__TryFinallyls
z"AstArcAnalyzer._handle__TryFinallyc
Cs�|�|j�}|�|j�}}|r0|�|jd�}|j�t|d��t|dd�}|j|j|d�}x|D]}|�	|j
||j�qdWt�}|j�
�}|�|j�t|dd�}|jr�|j|j|d�}	||	O}n|s�|�|�|S)Nr)r1z-the condition on line {lineno} was never true)r�)r�z.the condition on line {lineno} was never false)r�r�r�r�r�rur�r�r�r�r_r�rr�rJr�r�r8)
r(r�Z
constant_testr1Zto_topr�r�r�r�r�r*r*r+�_handle__While}s&



zAstArcAnalyzer._handle__WhilecCs"|�|�}|j|jt|�d�}|S)N)r�)r�r�r�r�)r(r�r1r�r*r*r+�
_handle__With�s
zAstArcAnalyzer._handle__WithcCsl|�|�}|jrL|j|jt|�d�}x@|D]}|�|j||jd�q,Wn|�||�|�||�dS)N)r�zdidn't exit the module)r�r�r�r�r�r_r�)r(r�r1r�r�r*r*r+�_code_object__Module�s

z#AstArcAnalyzer._code_object__ModulecCsN|�|�}|j�t||jd��|j|jt|�d�}|�|�|j�	�dS)N)r1r�)r�)
r�r�rur�r�r�r�r�r�r�)r(r�r1r�r*r*r+�_code_object__FunctionDef�s


z(AstArcAnalyzer._code_object__FunctionDefc	Cs\|�|�}|�||�|j|jt|�d�}x*|D]"}|�|j||jd�|j��q2WdS)N)r�z#didn't exit the body of class '{0}')	r�r�r�r�r�r_r�rtr�)r(r�r1r�r�r*r*r+�_code_object__ClassDef�s

z%AstArcAnalyzer._code_object__ClassDefcs�fdd�}|S)zFA function to make methods for online callable _code_object__ methods.c	sB|�|�}|�||dd��|��|�||dd��|��dS)Nzdidn't run the {0} on line {1}z!didn't finish the {0} on line {1})r�r�rt)r(r�r1)�nounr*r+�_code_object__oneline_callable�s

zPAstArcAnalyzer._make_oneline_code_method.<locals>._code_object__oneline_callabler*)rrr*)rr+�_make_oneline_code_method�sz(AstArcAnalyzer._make_oneline_code_method�lambdazgenerator expressionzdictionary comprehensionzset comprehensionzlist comprehension)NN)NN)6ryrzr{r|rrr,rir�r�ror�r�r�r�r�Z
OK_TO_DEFAULTr�r�r�r�r�r�r�r�r�Z_handle__ClassDefr�r�Z_handle__AsyncForZ_handle__FunctionDefZ_handle__AsyncFunctionDefr�r�r�r�r�r�rrrZ_handle__AsyncWithrrZ_code_object__AsyncFunctionDefrrZ_code_object__LambdaZ_code_object__GeneratorExpZ_code_object__DictCompZ_code_object__SetComprr�Z_code_object__ListCompr*r*r*r+rh�sd

	K

rh�ctxcCs$|dgdit�gkp"t|tttf�S)z:Is `value` simple enough to be displayed on a single line?Nr*)rr�rro�float)r�r*r*r+�_is_simple_value�srcCs�d|}t|tj�s.td�||jj|��dSt|dd�}|dk	rPd�|j�}nd}d�||jj|�}dd	�t�	|�D�}|s�td
�|��n�t
|�dkr�t|dd�r�|d\}}td
�|||��n�t|�|d}	x�|D]�\}}d�|	|�}
t|��rtd�|
|��q�t|t��rXtd�|
��x|D]}t
||d��q0Wtd�|	��q�t|
�t
||d�q�Wtd
�|��dS)z`Dump the AST for `node`.

    This recursively walks the AST, printing a readable version.

    � z{0}<{1} {2!r}>Nr_z @ {0}�z
{0}<{1}{2}cSs g|]\}}|tkr||f�qSr*)�SKIP_DUMP_FIELDS)rVr�r�r*r*r+r\�szast_dump.<locals>.<listcomp>z{0}>r0rz{0} {1}: {2!r}>z    z{0}{1}:z	{0} {1!r}z{0} [�z{0}])r�r��ASTrBrtr�ryr�r_�iter_fieldsr�rr�r�)r��depthrOr_Zlinemark�headZnamed_fields�
field_namer�Znext_indent�prefix�nr*r*r+r��s<

r�)r))r|r�rmr�r4r@rC�coveragerZcoverage.backwardrrrZcoverage.bytecoderZcoverage.debugrZ
coverage.miscrr	r
rrr
rZcoverage.phystokensrrr�objectrr-r�r�r��
namedtupler�rhrrr�r*r*r*r+�<module>s<MP
v