Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/coverage/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/coverage/__pycache__/parser.cpython-35.pyc



E�Wq��@s�dZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddl	mZmZddl
mZddlmZddlmZmZmZmZdd	lmZmZmZdd
lmZmZmZGdd�de�ZGd
d�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd�dej#dd��Z$eddd��Gdd�de�Z%dgZ&dd �Z'dd!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�ddddd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zddd�ZdS)�PythonParserz�Parse code to find executable lines, excluded lines, etc.

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

    �textzunicode|NoneNcCs7|s|std��|p!d|_||_|js�ddlm}y||j�|_Wn>tk
r�}ztd|j|f��WYdd}~XnX||_|jjd�|_	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/python35/lib64/python3.5/site-packages/coverage/parser.py�__init__s.		)					zPythonParser.__init__cCs+|js$t|jd|j�|_|jS)zCreate a ByteParser on demand.r)r%�
ByteParserrr)r(r*r*r+�byte_parser\s	zPythonParser.byte_parsercGs�t|�}tjr$|jd�}tj|�}t�}x?t|jdd�D](\}}|j	|�rR|j
|�qRW|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_matchingcCs�|jr|j|j�|_d}d}d}d}tj}d}d}d}t|j�}	xx|	D]p\}
}\}}
\}}
}|jr�tdt	j
j|
|
�t||f�||f�|
tjkr�|d7}n�|
tj
kr�|d8}nl|
tjkr,|dkrj|jj|�n>|
tjkr�|dkr�||jkpY|}|r�|r�|jj|�|}d}d}qj|d	krj|rj||jkr�d}|rj|jj|�n�|
tjkr|tjkr|jjt||d��n^|
tjkrj|dk	r^||kr^x(t||d�D]}||j|<qGWd}d}|j�r�|
t	jkr�d}|dkr�|}|r�||kr�d}|r�|jj|�d}|
}qgW|s�|jj|jj��dS)
zwParse the source to find the interesting facts about its lines.

        A handful of attributes are updated.

        rFNTz%10s %5s %-20r %rr1�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|jj||�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|]}�j|�VqdS)N)rP)�.0rS)r(r*r+�	<genexpr>�sz+PythonParser.first_lines.<locals>.<genexpr>)r)r(rr*)r(r+�first_lines�szPythonParser.first_linescCs
|j|�S)z)Implement `FileReporter.translate_lines`.)rX)r(rr*r*r+�translate_lines�szPythonParser.translate_linescs�fdd�|D�S)z(Implement `FileReporter.translate_arcs`.cs4g|]*\}}�j|��j|�f�qSr*)rP)rV�a�b)r(r*r+�
<listcomp>�s	z/PythonParser.translate_arcs.<locals>.<listcomp>r*)r(�arcsr*)r(r+�translate_arcs�szPythonParser.translate_arcscCs�y|j�Wn}tjtfk
r�}zTt|d�rG|j}n|jdd}td|j|jd|f��WYdd}~XnX|j	|j
�|_|j|jB}|j
|}|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.

        �linenor1rz5Couldn'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0
zPythonParser.parse_sourcecCs |jdkr|j�|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.arcscCs�t|j|j|j�}|j�t�|_xW|jD]L\}}|j|�}|j|�}||kr;|jj	||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�tjt�}x[|j�D]M\}}|dkr7q||jkrIq||jkr[q||d7<qWx+|jD] }||krw||d8<qwW|S)zYGet a count of exits from that each line.

        Excluded lines are excluded.

        rr1)�collections�defaultdict�intr]rr!)r(�exit_countsrkrlrSr*r*r+rpszPythonParser.exit_countscCss|jdkr|j�|}|rr|dkrr||krr||f|krr||f|jkrr||}}|jj||fdg�}g}x�|D]�}|\}}	|	dkr�|dkr�||f|jkr�|j||�Sd}	nd}	|	jd|�}	djd|d|	�}
|dk	rU|
d	jd
|jd|��7}
|j|
�q�Wdj|�S)
z5Provide an English sentence describing a missing arc.Nrz didn't jump to the function exitzdidn't jump to line {lineno}r_zline {start} {emsg}r0�emsgz, because {smsg}�smsgz or )NN)r'rgrE�missing_arc_description�format�append�join)r(r0�endZ
executed_arcsZactual_startZfragment_pairsZmsgsZ
fragment_pairrrrq�msgr*r*r+rs8s0


	"z$PythonParser.missing_arc_description)�__name__�
__module__�__qualname__�__doc__rr,�propertyr.r<rTrPrXrYr^rfr]rgrprsr*r*r*r+rs=[	rc@s[eZdZdZedd�dddd��Zdd�Zd	d
�Zdd�ZdS)
r-z3Parse bytecode to understand the structure of code.r�unicodeNcCs�||_|r||_n`yt||d�|_WnDtk
rz}z$td||j|jf��WYdd}~XnXx5dddgD]$}t|j|�s�td��q�WdS)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__cs&t�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�jd|�VqdS)r�N)r-r)rV�c)r(r*r+rW�sz+ByteParser.child_parsers.<locals>.<genexpr>)rr�)r(�childrenr*)r(r+�
child_parsers}szByteParser.child_parsersccs�t|jjddd��}t|jjddd��}d}|jj}d}xTt||�D]C\}}|r�||kr�||fV|}||7}||7}qfW||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�r1)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_linesccs=x6|j�D](}x|j�D]\}}|Vq Wq
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)	ryrzr{r|rr,r�r�rNr*r*r*r+r-bs	r-c@s"eZdZdZdd�ZdS)�	LoopBlockz@A block on the block stack representing a `for` or `while` loop.cCs||_t�|_dS)N)r0r�break_exits)r(r0r*r*r+r,�s	zLoopBlock.__init__N)ryrzr{r|r,r*r*r*r+r��sr�c@s"eZdZdZdd�ZdS)�
FunctionBlockz>A block on the block stack representing a function definition.cCs||_||_dS)N)r0�name)r(r0r�r*r*r+r,�s	zFunctionBlock.__init__N)ryrzr{r|r,r*r*r*r+r��sr�c@s(eZdZdZdddd�ZdS)�TryBlockz6A block on the block stack representing a `try` block.NcCsF||_||_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__)ryrzr{r|r,r*r*r*r+r��sr�cs+eZdZdZd�fdd�Z�S)�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|�j|||�S)N)�superr��__new__)�clsr_�cause)�	__class__r*r+r��szArcStart.__new__)ryrzr{r|r�r*r*)r�r+r��sr�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>�sr�c
@syeZdZdZeddde�dd��Zdd�Zd	d	d
d�Zdd
�Z	ede
�dd��Zdd�Zdd�Z
dd�Zdd�Zedddddddd d!d"d#d$g�Zedd%�d&d'��Zedd%�d	d	d(d)��Zd*d+�Zed,d%�d-d.��Zed,d%�d/d0��Zed,d%�d1d2��Zed,d%�d3d4��Zedd%�d5d6��Zedd%�d7d8��ZeZedd%�d9d:��Zedd%�d;d<��ZeZeZeZedd%�d=d>��Z edd%�d?d@��Z!edd%�dAdB��Z"edd%�dCdD��Z#dEdF�Z$edd%�dGdH��Z%edd%�dIdJ��Z&edd%�dKdL��Z'edd%�dMdN��Z(e(Z)dOdP�Z*dQdR�Z+e+Z,dSdT�Z-dUdV�Z.e.dW�Z/e.dX�Z0e.dY�Z1e.dZ�Z2e3j4rue.d[�Z5d	S)\rhz>Analyze source text with an AST to find executable code paths.rr~rcs�tjt|��|_t�fdd�|D��|_�|_ttj	j
dd��r�tdj|j��tdj|j��t
|j�t�|_tjt�|_g|_tttj	j
dd���|_dS)Nc3s!|]}�j||�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__cCsYxRtj|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.analyzeNcCs�|jr8tdj||||��ttdd��|jj||f�|dk	sf|dk	r�|j||fj||f�dS)z@Add an arc, including message fragments to use if it is missing.z!
Adding arc: ({}, {}): {!r}, {!r}�limit�N)r�rBrtrr]r8rjru)r(r0rwrrrqr*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_blocksZreturnscCsC|jj}t|d|d�}|dk	r8||�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|j�S)N)r��value)r(r�r*r*r+�
_line__AssignszAstArcAnalyzer._line__AssigncCsUtjdkrJ|jrJ|jddk	r9|jdjS|jdjSn|jSdS)N��r)r�r�)rZ	PYVERSION�keysr_�values)r(r�r*r*r+�_line__Dict!s
zAstArcAnalyzer._line__DictcCs(|jr|j|jd�S|jSdS)Nr)�eltsr�r_)r(r�r*r*r+�_line__List-s	zAstArcAnalyzer._line__ListcCs%|jr|j|jd�SdSdS)Nrr1)�bodyr�)r(r�r*r*r+�
_line__Module3s	zAstArcAnalyzer._line__Module�Assign�Assert�	AugAssign�DeleteZExec�Expr�Global�Import�
ImportFrom�Nonlocal�PassZPrintr�cCsZ|jj}t|d|d�}|dk	r8||�Stt|j|�dd�g�S)zhAdd the arcs for `node`.

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

        Z	_handle__Nr�)r�ryr�rr�r�)r(r�r�r�r*r*r+�add_arcs?s

zAstArcAnalyzer.add_arcscCs�|dkrt|g�}x}|D]u}|j|�}|jj||�}||jkr^q"x'|D]}|j|j||j�qeW|j|�}q"W|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_arcscCsH|jj}|d	krdS|dkrDtjrD|jd
krDdSdS)z Is this a compile-time constant?�NameConstant�NumT�Name�True�False�NoneF)r�r�)r�r�r�)r�ryr�PY3�id)r(r�r�r*r*r+�is_constant_expriszAstArcAnalyzer.is_constant_expr�exitscCsmxf|j�D]X}t|t�r6|jj|�Pq
t|t�r
|jdk	r
|jj|�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_exitszsz"AstArcAnalyzer.process_break_exitscCs�x�|j�D]u}t|t�rSx*|D]"}|j|j|j|j�q)WPq
t|t�r
|jdk	r
|j	j
|�Pq
WdS)z3Add arcs due to jumps from `exits` being continues.N)r�r�r�r�r_r0r�r�r�r�rJ)r(r�r��xitr*r*r+�process_continue_exits�s
 z%AstArcAnalyzer.process_continue_exitscCs�x�|j�D]�}t|t�r�|jdk	rbx*|D]"}|j|j|j|j�q8WPq�|jdk	r�|jj	|�Pq
t|t
�r
x:|D]2}|j|j|j|jdj|j
��q�WPq
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�r0rtr�)r(r�r�r�r*r*r+�process_raise_exits�s
 
z"AstArcAnalyzer.process_raise_exitscCs�x�|j�D]�}t|t�rE|jdk	rE|jj|�Pq
t|t�r
x:|D]2}|j|j|j	|j
dj|j��q[WPq
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_r0r�rtr�)r(r�r�r�r*r*r+�process_return_exits�s
z#AstArcAnalyzer.process_return_exitscCs8|j|�}t|dd�}|j|g�t�S)Nr�z*the break on line {lineno} wasn't executed)r�r�r�r)r(r��hereZbreak_startr*r*r+�_handle__Break�szAstArcAnalyzer._handle__BreakcCs�|j|�}|jr�xB|jD]7}|j|�}||kr"|j||�|}q"W|j|jd�}|jj||�}x@t|d|�D]+}||jkr�|j||�|}q�Wtt	|dd�g�S)zBAdd arcs for things that can be decorated (classes and functions).rr1r�N)
r�Zdecorator_listr�r�r�rErrrr�)r(r��lastZdec_nodeZ	dec_startZ
body_startr_r*r*r+�_handle_decorated�s	

z AstArcAnalyzer._handle_decoratedcCs8|j|�}t|dd�}|j|g�t�S)Nr�z-the continue on line {lineno} wasn't executed)r�r�r�r)r(r�r�Zcontinue_startr*r*r+�_handle__Continue�sz AstArcAnalyzer._handle__ContinuecCs�|j|j�}|jjtd|��t|dd�}|j|jd|�}x'|D]}|j|j	||j
�q\W|jj�}|j}t|dd�}|j
r�|j|j
d|�}||O}n
|j|�|S)Nr0r�z'the loop on line {lineno} never startedr�z)the loop on line {lineno} didn't complete)r��iterr�rur�r�r�r�r�r_r��popr��orelser8)r(r�r0r�r�r��my_block�
else_exitsr*r*r+�_handle__For�s
		

zAstArcAnalyzer._handle__ForcCsn|j|j�}t|dd�}|j|jd|�}t|dd�}||j|jd|�O}|S)Nr�z-the condition on line {lineno} was never truer�z.the condition on line {lineno} was never false)r��testr�r�r�r�)r(r�r0r�r�r*r*r+�_handle__If�szAstArcAnalyzer._handle__IfcCs8|j|�}t|dd�}|j|g�t�S)Nr�z*the raise on line {lineno} wasn't executed)r�r�r�r)r(r�r�Zraise_startr*r*r+�_handle__Raise�szAstArcAnalyzer._handle__RaisecCs8|j|�}t|dd�}|j|g�t�S)Nr�z+the return on line {lineno} wasn't executed)r�r�r�r)r(r�r�Zreturn_startr*r*r+�_handle__ReturnszAstArcAnalyzer._handle__ReturncCs�|jr"|j|jd�}nd}|jrJ|j|jd�}nd}td|d|�}|jj|�|j|�}|j|jdt|dd��}|jr�d|_	|jr�t
g�|_n
|jj�t
�}|jrsd}xv|jD]k}	|j|	�}|dk	r5|j
||�|}d}
t|d|
�}||j|	jd|�O}qW|jr�|j|jd|�}||O}|jr�|jj�||jB|jB|jB|jB}|j|jd|�}|jr|j|j|�}
|j|
�|jrD|j|j|�}|j|�|jro|j|j|�}|j|�|jr�|j|j|�}|j|�|S)Nrr�r�r�r�z3the exception caught by line {lineno} didn't happenr�)�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_blockr0r�Z
handler_exitsZlast_handler_startZhandler_nodeZ
from_causer�Z
final_fromr�Zcontinue_exitsZraise_exitsZreturn_exitsr*r*r+�_handle__Trys^		$			
		 	
	

	
	
	
	
zAstArcAnalyzer._handle__Trycszg}x?t|�D]1\}��dk	r|j�jd|��qWdj|��t�fdd�|D��}|S)z4Helper for building the cause of `finally` branches.Nr_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|_|j|�S)N)r�r�)r(r�r*r*r+�_handle__TryExceptds	z!AstArcAnalyzer._handle__TryExceptcCs�g|_g|_|jd}|jjdkr�|j|jkr�t|j�dks^t�|j|_|j|_|j|_|j|�S)NrZ	TryExceptr1)	r�r�r�r�ryr_�lenrr�)r(r��firstr*r*r+�_handle__TryFinallyls		
$z"AstArcAnalyzer._handle__TryFinallyc
Cs0|j|j�}|j|j�}}|rD|j|jd�}|jjtd|��t|dd�}|j|jd|�}x'|D]}|j	|j
||j�q�Wt�}|jj
�}|j|j�t|dd�}|jr|j|jd|�}	||	O}n|s,|j|�|S)Nrr0r�z-the condition on line {lineno} was never truer�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_testr0Zto_topr�r�r�r�r�r*r*r+�_handle__While}s&
		

zAstArcAnalyzer._handle__WhilecCs1|j|�}|j|jdt|��}|S)Nr�)r�r�r�r�)r(r�r0r�r*r*r+�
_handle__With�szAstArcAnalyzer._handle__WithcCs�|j|�}|jrh|j|jdt|��}xP|D]#}|j|j||jd�q>Wn"|j||�|j||�dS)Nr�zdidn't exit the module)r�r�r�r�r�r_r�)r(r�r0r�r�r*r*r+�_code_object__Module�s	
$z#AstArcAnalyzer._code_object__ModulecCsn|j|�}|jjtd|d|j��|j|jdt|��}|j|�|jj	�dS)Nr0r�r�)
r�r�rur�r�r�r�r�r�r�)r(r�r0r�r*r*r+�_code_object__FunctionDef�s
"
z(AstArcAnalyzer._code_object__FunctionDefcCs||j|�}|j||�|j|jdt|��}x7|D]/}|j|j||jdj|j��qEWdS)Nr�z#didn't exit the body of class '{0}')	r�r�r�r�r�r_r�rtr�)r(r�r0r�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.csY|j|�}|j||ddj�|��|j||ddj�|��dS)Nzdidn't run the {0} on line {1}z!didn't finish the {0} on line {1})r�r�rt)r(r�r0)�nounr*r+�_code_object__oneline_callable�s
#
zPAstArcAnalyzer._make_oneline_code_method.<locals>._code_object__oneline_callabler*)rrr*)rr+�_make_oneline_code_method�sz(AstArcAnalyzer._make_oneline_code_method�lambdazgenerator expressionzdictionary comprehensionzset comprehensionzlist comprehension)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�r�r�rZ_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�ctxcCs4|dgfit�gkp3t|tttf�S)z:Is `value` simple enough to be displayed on a single line?N)rr�rro�float)r�r*r*r+�_is_simple_value�sr
cCsd|}t|tj�s?tdj||jj|��dSt|dd�}|dk	rrdj|j�}nd}dj||jj|�}dd	�tj	|�D�}|s�td
j|��n<t
|�dkrt|dd�r|d\}}td
j|||��n�t|�|d}	x�|D]�\}}dj|	|�}
t|�r{tdj|
|��q8t|t�r�tdj|
��x|D]}t
||d�q�Wtdj|	��q8t|
�t
||d�q8Wtd
j|��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\�s		zast_dump.<locals>.<listcomp>z{0}>r1rz{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�rmr�r4r@rC�coveragerZcoverage.backwardrrrZcoverage.bytecoderZcoverage.debugrZ
coverage.miscrr	r
rrr
rZcoverage.phystokensrrr�objectrr-r�r�r��
namedtupler�rhr
r
r�r*r*r*r+�<module>s6"�LP"
��