Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
B


ÿ¼–b—Iã@s†dZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddl	mZmZddl
mZddlmZddlmZmZmZmZmZdd	lmZmZmZdd
lmZmZmZGdd„deƒZGd
d„deƒZ Gdd„deƒZ!Gdd„deƒZ"Gdd„deƒZ#Gdd„de $dd¡ƒZ%eddd„ƒe&e'ej( )dd¡ƒƒZ*Gdd„deƒZ+Gdd „d eƒZ,e*r‚d!gZ-d"d#„Z.d&d$d%„Z/dS)'zCode parsing for coverage.py.éN)Úenv)Úrange)Ú
bytes_to_intsÚstring_class)Úcode_objects)Úshort_stack)ÚcontractÚ
join_regexÚnew_contractÚ	nice_pairÚone_of)ÚNoSourceÚ	NotPythonÚStopEverything)Ú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+ú/build/wlanpi-profiler-MIf3Xw/wlanpi-profiler-1.0.8/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/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)r	rÚPY2ÚdecodeÚreÚcompilerÚ	enumeraterÚsearchÚadd)r)ZregexesZcombinedZregex_cÚmatchesÚiÚltextr+r+r,Úlines_matchingcs


zPythonParser.lines_matchingcCsj|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 ¡¡tjjrf|jrft |jƒ|jd<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"r9ÚOPÚSTRINGr#ÚupdaterÚNEWLINEr%ÚstripÚCOMMENTr r/Ú_find_statementsrÚ
PYBEHAVIORÚmodule_firstline_1Úmin)r)ÚindentZexclude_indentZ	excludingZexcluding_decoratorsZprev_toktypeÚ
first_lineÚemptyZ
first_on_lineZtokgenZtoktypeZttextZslinenoÚ_Zelinenor<Zshould_excludeÚlr+r+r,Ú
_raw_parseust
 




zPythonParser._raw_parsecCs0|dkr|j ||¡}n|j ||¡}|S)z?Return the first line number of the statement including `line`.r)r%rF)r)Úliner+r+r,rTÖszPythonParser.first_linecs‡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.

        csh|]}ˆ |¡’qSr+)rT)Ú.0rW)r)r+r,ú	<setcomp>åsz+PythonParser.first_lines.<locals>.<setcomp>r+)r)rr+)r)r,Úfirst_linesÞszPythonParser.first_linescCs
| |¡S)z)Implement `FileReporter.translate_lines`.)r\)r)rr+r+r,Útranslate_linesçszPythonParser.translate_linescs‡fdd„|DƒS)z(Implement `FileReporter.translate_arcs`.cs$g|]\}}ˆ |¡ˆ |¡f‘qSr+)rT)rZÚ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.

        Úlinenor1rz5Couldn't parse '%s' as Python source: '%s' at line %dN)rXrDÚ
TokenErrorÚIndentationErrorÚhasattrrcÚargsrrr\r!rr#r r)r)r*rcÚ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,ra	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)ÚAstArcAnalyzerrr r%Úanalyzerr'rarTr9Úmissing_arc_fragmentsr()r)ZaaaÚl1Úl2Zfl1Zfl2r+r+r,rks

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.

        rr1)ÚcollectionsÚdefaultdictÚintrarr")r)Úexit_countsrorprWr+r+r,rt&s


zPythonParser.exit_countsc
Cs|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})rczline {start} {emsg})r2Úemsgz, because {smsg})Úsmsgz or )r(rkrFÚmissing_arc_descriptionÚformatÚappendÚjoin)
r)r2ÚendZ
executed_arcsZactual_startZfragment_pairsZmsgsrvruÚmsgr+r+r,rwAs.

z$PythonParser.missing_arc_description)NNN)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rr-Úpropertyr/r=rXrTr\r]rbrjrarkrtrwr+r+r+r,rs=a	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_firstlinenozsThis implementation of Python doesn't support code analysis.
Run coverage.py under another Python for this command.)	rÚcoderÚSyntaxErrorrr|rcrfr)r)rr†rZsynerrÚattrr+r+r,r-ls$
zByteParser.__init__cs‡fdd„tˆjƒ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)rZÚc)r)r+r,ú	<genexpr>Šsz+ByteParser.child_parsers.<locals>.<genexpr>)rr†)r)r+)r)r,Ú
child_parsers„szByteParser.child_parsersc
csÚt|jdƒr6xÈ|j ¡D]\}}}|dk	r|VqWn t|jjddd…ƒ}t|jjddd…ƒ}d}|jj}d}xTt||ƒD]F\}}	|r¤||krœ|V|}||7}tjj	r¼|	dkr¼|	d8}	||	7}q~W||krÖ|VdS)z·Yield the line numbers possible in this code object.

        Uses co_lnotab described in Python/compile.c to find the
        line numbers.  Produces a sequence: l0, l1, ...
        Úco_linesNrér1é€é)
rfr†rŒrr„r…ÚziprrPZnegative_lnotab)
r)rVrYÚbyte_incrementsÚline_incrementsZ
last_line_numÚline_numZbyte_numÚ	byte_incrÚ	line_incrr+r+r,Ú
_line_numbersŒs(zByteParser._line_numbersccs.x(| ¡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)ZbprWr+r+r,rOªszByteParser._find_statements)NN)	r}r~rr€rr-r‹r–rOr+r+r+r,r.isr.c@s"eZdZdZeeddd„ƒZdS)Ú	LoopBlockz@A block on the block stack representing a `for` or `while` loop.)r2cCs||_tƒ|_dS)N)r2rÚbreak_exits)r)r2r+r+r,r-½szLoopBlock.__init__N)r}r~rr€rrsr-r+r+r+r,r—»sr—c@s$eZdZdZeeeddd„ƒZdS)Ú
FunctionBlockz>A block on the block stack representing a function definition.)r2ÚnamecCs||_||_dS)N)r2rš)r)r2ršr+r+r,r-ÇszFunctionBlock.__init__N)r}r~rr€rrsÚstrr-r+r+r+r,r™Åsr™c@s$eZdZdZeddddd„ƒZdS)ÚTryBlockz6A block on the block stack representing a `try` block.zint|None)Ú
handler_startÚfinal_startcCs0||_||_tƒ|_tƒ|_tƒ|_tƒ|_dS)N)rržrÚ
break_fromÚ
continue_fromÚreturn_fromÚ
raise_from)r)rržr+r+r,r-ÑszTryBlock.__init__N)r}r~rr€rr-r+r+r+r,rœÏsrœcs"eZdZdZd‡fdd„	Z‡ZS)ÚArcStarta¸The information needed to start an arc.

    `lineno` is the line number the arc starts from.

    `cause` is an English text fragment used as the `startmsg` for
    AstArcAnalyzer.missing_arc_fragments.  It will be used to describe why an
    arc wasn't executed, so should fit well into a sentence of the form,
    "Line 17 didn't run because {cause}."  The fragment can include "{lineno}"
    to have `lineno` interpolated into it.

    Ncstt|ƒ |||¡S)N)Úsuperr£Ú__new__)ÚclsrcÚcause)Ú	__class__r+r,r¥ìszArcStart.__new__)N)r}r~rr€r¥Ú
__classcell__r+r+)r¨r,r£àsr£ZArcz
lineno, causeÚ	ArcStartscCstdd„|DƒƒS)Ncss|]}t|tƒVqdS)N)Ú
isinstancer£)rZÚxr+r+r,rŠòsz<lambda>.<locals>.<genexpr>)Úall)Úseqr+r+r,Ú<lambda>òór¯ZCOVERAGE_AST_DUMPc@seZdZdZdd„ZdS)ÚNodeListzÁA synthetic fictitious node, containing a sequence of nodes.

    This is used when collapsing optimized if-statements, to represent the
    unconditional execution of one of the clauses.

    cCs||_|dj|_dS)Nr)Úbodyrc)r)r²r+r+r,r-szNodeList.__init__N)r}r~rr€r-r+r+r+r,r±ùsr±c@s²eZdZdZededdd„ƒZdd„Zeeeddjd
d„ƒZ	dd
„Z
eeddd„ƒZdd„Zdd„Z
eZdd„ZeZeZdd„Zdd„Zdddddd d!d"d#d$d%d&hZed'dd(d)„ƒZed*ƒed'ddkd+d,„ƒƒZd-d.„Zd/d0„Zd1d2„Zd3d4„Zd5d6„Zed'd7d8d9„ƒZed'd7d:d;„ƒZed'd7d<d=„ƒZed'd7d>d?„ƒZ ed'dd@dA„ƒZ!ed'ddBdC„ƒZ"e"Z#ed'ddDdE„ƒZ$ed'ddFdG„ƒZ%e%Z&e"Z'e"Z(ed'ddHdI„ƒZ)ed'ddJdK„ƒZ*ed'ddLdM„ƒZ+ed'ddNdO„ƒZ,ed'ddPdQ„ƒZ-ed'd'd'dRdSdT„ƒZ.ed'ddUdV„ƒZ/ed'ddWdX„ƒZ0ed'ddYdZ„ƒZ1ed'dd[d\„ƒZ2e2Z3d]d^„Z4d_d`„Z5e5Z6dadb„Z7dcdd„Z8e8deƒZ9e8dfƒZ:e8dgƒZ;e8dhƒZ<e=j>r®e8diƒZ?d	S)lrlz>Analyze source text with an AST to find executable code paths.r‚)rrcsŽt t|ƒ¡|_‡fdd„|Dƒ|_ˆ|_trXtd |j¡ƒtd |j¡ƒt	|jƒt
ƒ|_t 
t¡|_g|_tttj dd¡ƒƒ|_dS)Ncsh|]}ˆ ||¡’qSr+)rF)rZrW)Ú	multiliner+r,r[sz*AstArcAnalyzer.__init__.<locals>.<setcomp>zStatements: {}zMultiline map: {}ZCOVERAGE_TRACK_ARCSr)ÚastÚparserÚ	root_noderr³ÚAST_DUMPrCrxÚast_dumprrarqrrÚlistrnÚblock_stackÚboolrsÚosÚenvironrFÚ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¨r}Úgetattr)r)ÚnodeÚ	node_nameZcode_object_handlerr+r+r,rm&s
zAstArcAnalyzer.analyze)r2r{NcCsd|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¾rCrxrrar9rnry)r)r2r{rvrur+r+r,Úadd_arc3s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)ÚreturnscCs2|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¨r}rÀrc)r)rÁrÂÚhandlerr+r+r,Ú
line_for_nodeBs
zAstArcAnalyzer.line_for_nodecCs$|j}tjjr |jr |jdj}|S)zSCompute first line number for things that can be decorated (classes and functions).r)rcrrPÚtrace_decorated_defÚdecorator_list)r)rÁrcr+r+r,Ú_line_decoratedPs
zAstArcAnalyzer._line_decoratedcCs| |j¡S)N)rÊÚvalue)r)rÁr+r+r,Ú
_line__AssignXszAstArcAnalyzer._line__AssigncCsBtjdkr8|jr8|jddk	r*|jdjS|jdjSn|jSdS)N)éér)rZ	PYVERSIONÚkeysrcÚvalues)r)rÁr+r+r,Ú_line__Dict]s
zAstArcAnalyzer._line__DictcCs |jr| |jd¡S|jSdS)Nr)ZeltsrÊrc)r)rÁr+r+r,Ú_line__ListlszAstArcAnalyzer._line__ListcCs*tjjrdS|jr"| |jd¡SdSdS)Nr1r)rrPrQr²rÊ)r)rÁr+r+r,Ú
_line__Modulers
zAstArcAnalyzer._line__ModuleZAssignZAssertZ	AugAssignZDeleteZExecZExprZGlobalZImportZ
ImportFromZNonlocalZPassZPrintrªcCs<|jj}t|d|dƒ}|dk	r(||ƒSt| |¡ƒhSdS)aÆAdd the arcs for `node`.

        Return a set of ArcStarts, exits from this node to the next. Because a
        node represents an entire sub-tree (including its children), the exits
        from a node can be arbitrarily complex::

            if something(1):
                if other(2):
                    doit(3)
                else:
                    doit(5)

        There are two exits from line 1: they start at line 3 and line 5.

        Z	_handle__N)r¨r}rÀr£rÊ)r)rÁrÂrÉr+r+r,Úadd_arcss

zAstArcAnalyzer.add_arcszfrom_start, prev_startscCsŠ|dkr|h}xv|D]n}| |¡}|j ||¡}||jkrX| |¡}|dkrNq| |¡}x|D]}| |j||j¡q^W| |¡}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)	rÊr³rFrÚfind_non_missing_noderÅrcr§r×)r)r²Ú
from_startÚprev_startsZ	body_nodercrTZ
prev_startr+r+r,Ú
add_body_arcs¡s






zAstArcAnalyzer.add_body_arcscCsP| |¡}|j ||¡}||jkr&|St|d|jjdƒ}|rH||ƒ}nd}|S)aSearch `node` looking for a child that has not been optimized away.

        This might return the node you started with, or it will work recursively
        to find a child node in self.statements.

        Returns a node, or None if none of the node remains.

        Z
_missing__N)rÊr³rFrrÀr¨r})r)rÁrcrTZ
missing_fnr+r+r,rؽs


z$AstArcAnalyzer.find_non_missing_nodecCs2| t|jƒ¡}|r|S|jr.| t|jƒ¡SdS)N)rØr±r²Úorelse)r)rÁZnon_missingr+r+r,Ú_missing__IfÜszAstArcAnalyzer._missing__IfcCsTg}x*|jD] }| |¡}|dk	r| |¡qW|s8dSt|ƒdkrL|dSt|ƒS)Nr1r)r²rØryÚlenr±)r)rÁZnon_missing_childrenÚchildr+r+r,Ú_missing__NodeListçs
z!AstArcAnalyzer._missing__NodeListcCsV| t|jƒ¡}|sdSt ¡}|j|_t ¡|_|j|j_d|j_|j|_d|_	|S)NÚTrue)
rØr±r²r´ZWhilercÚNameÚtestÚidrÜ)r)rÁZ
body_nodesZ	new_whiler+r+r,Ú_missing__While÷s

zAstArcAnalyzer._missing__WhilecCs.|jj}|dkrdS|dkr*|jdkr*dSdS)z Is this a compile-time constant?)ZConstantÚNameConstantÚNumrçrâ)ráÚFalseÚNoneÚ	__debug__N)r¨r}rä)r)rÁrÂr+r+r,Úis_constant_exprs
zAstArcAnalyzer.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˜rKrœržrŸ)r)rìÚblockr+r+r,Úprocess_break_exitss
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Årcr2r§rœržr rK)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 {!r})rÇr«rœrrÅrcr§ržr¢rKr™r2rxrš)r)rìrírïr+r+r,Úprocess_raise_exits6s





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 {!r})
rÇr«rœržr¡rKr™rÅrcr2r§rxrš)r)rìrírïr+r+r,Úprocess_return_exitsJs

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__Breakbs
zAstArcAnalyzer._handle__BreakcCsÎ|j}}|jrÄtjjrd}x8|jD].}| |¡}|dk	rN||krN| ||¡|}q$Wtjjrn| ||¡|}|jrÄ| |jd¡}|j 	||¡}x0t
|d|ƒD]}||jkr¢| ||¡|}q¢Wt|ƒhS)zBAdd arcs for things that can be decorated (classes and functions).Nrr1)
rcrÌrrPrËrÊrÅr²r³rFrrr£)r)rÁZ	main_lineÚlastZdec_nodeZ	dec_startZ
body_startrcr+r+r,Ú_handle_decoratedis(


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)r2z'the loop on line {lineno} never started)r§)rÙz)the loop on line {lineno} didn't complete)rÊÚiterrºryr—r£rÛr²rÅrcr§Úpopr˜rÜr9)r)rÁr2rÙ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Êrãr£rÛr²rÜ)r)rÁr2rÙrìr+r+r,Ú_handle__If¨szAstArcAnalyzer._handle__IfcCs"| |¡}|j|jt|ƒd}|S)N)rÙ)rÊrÛr²r£)r)rÁr2rìr+r+r,Ú_handle__NodeList±s
z AstArcAnalyzer._handle__NodeListcCs(| |¡}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__Return¿s
zAstArcAnalyzer._handle__ReturncCsè|jr| |jd¡}nd}|jr4| |jd¡}nd}t||ƒ}|j |¡| |¡}|j|jt|ƒd}|jrˆd|_	|jr’t
ƒ|_n
|j ¡t
ƒ}|jrød}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Îtjjr¶xD|jD]:}|j}|jj|d}x|
D]}| 
|j||¡qŽWqpW|j}n| |j|
¡}| |¡|jrFtjjr.xD|jD]:}|j}|jj|d}x|
D]}| 
|j||¡qWqèW|j}n| |j|
¡}| |¡|jrb| | |j|
¡¡|jrÚtjjrÂxD|jD]:}|j}|jj|d}x|
D]}| 
|j||¡qšWq|W|j}n| |j|
¡}| |¡|rä|
}|S)Nr)rÙz3the exception caught by line {lineno} didn't happen)r§)rÚ)rc)ÚhandlersrÊÚ	finalbodyrœrºryrÛr²r£rrr¢rùrÅrÜrŸr r¡rrPZfinally_jumps_backrcr§rxÚ_combine_finally_startsrîrðrñrò)r)rÁrržZ	try_blockr2rìZ
handler_exitsZlast_handler_startZhandler_nodeZ
from_causerÙZ
final_fromZfinal_exitsZ
break_linercr§Z
final_exitZbreaksZ
continue_lineZ	continuesZreturn_linerÈr+r+r,Ú_handle__TryÇsŒ














zAstArcAnalyzer._handle__Try)rirìrÈcsVg}x0t|ƒD]$}|jdk	r| |jj|jd¡qWd |¡‰‡fdd„|Dƒ}|S)aHelper for building the cause of `finally` branches.

        "finally" clauses might not execute their exits, and the causes could
        be due to a failure to execute any of the exits in the try block. So
        we use the causes from `starts` as the causes for `exits`.
        N)rcz or csh|]}t|jˆƒ’qSr+)r£rc)rZrï)r§r+r,r[Asz9AstArcAnalyzer._combine_finally_starts.<locals>.<setcomp>)Úsortedr§ryrxrcrz)r)rirìÚcausesr2r+)r§r,r4s

z&AstArcAnalyzer._combine_finally_startscCsg|_| |¡S)N)rr)r)rÁr+r+r,Ú_handle__TryExceptDsz!AstArcAnalyzer._handle__TryExceptcCsbg|_g|_|jd}|jjdkrX|j|jkrXt|jƒdks@t‚|j|_|j|_|j|_| |¡S)NrZ	TryExceptr1)	rrÜr²r¨r}rcrÞrr)r)rÁÚfirstr+r+r,Ú_handle__TryFinallyLs
z"AstArcAnalyzer._handle__TryFinallycCsþ| |j¡}}| |j¡}d}|r6tjs2|dkr6d}tjjrBd}|rV| |jd¡}|j 	t
|d¡t|dd}|j|j|d}x|D]}| 
|j||j¡qŠWtƒ}|j ¡}	| |	j¡t|d	d}|jrì|j|j|d}
||
O}n|sú| |¡|S)
NFrçTr)r2z-the condition on line {lineno} was never true)r§)rÙz.the condition on line {lineno} was never false)rÊrãrërÚPY3rPZkeep_constant_testr²rºryr—r£rÛrÅrcr§rrùrKr˜rÜr9)r)rÁr2Zto_topZ
constant_testZtop_is_body0rÙrìrïrúrûr+r+r,Ú_handle__While]s0



zAstArcAnalyzer._handle__WhilecCs"| |¡}|j|jt|ƒd}|S)N)rÙ)rÊrÛr²r£)r)rÁr2rìr+r+r,Ú
_handle__Withzs
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Årcr§)r)rÁr2rìrïr+r+r,Ú_code_object__Module‚s

z#AstArcAnalyzer._code_object__ModulecCsN| |¡}|j t||jd¡|j|jt|ƒd}| |¡|j 	¡dS)N)r2rš)rÙ)
rÊrºryr™ršrÛr²r£ròrù)r)rÁr2rì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 {!r})	rÊrÅrÛr²r£rcr§rxrš)r)rÁr2rì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 {} on line {}zdidn't finish the {} on line {})rÊrÅrx)r)rÁr2)Ú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)@r}r~rr€rrr-rmrsrÅrÇrÊrÍrÏZ_line__ClassDefrÔZ_line__FunctionDefZ_line__AsyncFunctionDefrÕrÖZ
OK_TO_DEFAULTr×rrÛrØrÝràrårërîrðrñròrôröZ_handle__ClassDefr÷rüZ_handle__AsyncForZ_handle__FunctionDefZ_handle__AsyncFunctionDefrýrþrÿrrrrr	rrZ_handle__AsyncWithr
rZ_code_object__AsyncFunctionDefrrZ_code_object__LambdaZ_code_object__GeneratorExpZ_code_object__DictCompZ_code_object__SetComprr
Z_code_object__ListCompr+r+r+r,rl	sx

 	m
rlÚctxcCs$|dgditƒgkp"t|tttfƒS)z:Is `value` simple enough to be displayed on a single line?Nr+)rr«rrsÚfloat)rÎr+r+r,Ú_is_simple_value¸src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)zhDump the AST for `node`.

        This recursively walks the AST, printing a readable version.

        ú z{}<{} {!r}>Nrcz @ {}Úz{}<{}{}cSs g|]\}}|tkr||f‘qSr+)ÚSKIP_DUMP_FIELDS)rZršrÎr+r+r,r`Òszast_dump.<locals>.<listcomp>z{}>r1rz{} {}: {!r}>z    z{}{}:z{} {!r}z{} [éz{}])r«r´ÚASTrCrxr¨r}rÀrcÚiter_fieldsrÞrr¹r¸)rÁÚdepthrSrcZlinemarkÚheadZnamed_fieldsÚ
field_namerÎZnext_indentÚprefixÚnr+r+r,r¸¿s<

r¸)r)0r€r´rqr¼r5rArDZcoveragerZcoverage.backwardrrrZcoverage.bytecoderZcoverage.debugrZ
coverage.miscrr	r
rrr
rrZcoverage.phystokensrrrÚobjectrr.r—r™rœÚ
namedtupler£r»rsr½rFr·r±rlrrr¸r+r+r+r,Ú<module>sFTR

/