Repository URL to install this package:
Version:
1.0.8-1 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
coverage
/
__pycache__
/
phystokens.cpython-37.pyc
|
---|
B ñ¼·Αäã @ sü d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z mZ ddlm Z dd Ze dd d d ZG dd d eZe jZejdejdZe dd dd Ze dd dd ZejrÎeZneZe dd dd Ze ddddd ZdS )z"Better tokenizing for coverage.py.é N)Úenv)ÚiternextÚ unicode_class)Úcontractc c sò d}d}d}xà| D ]Ø\}}\}}\}} } ||krº|r¶| d¡r¶d}| d¡rRd}n.|tjkrd|kr| dd¡d d dkrd}|r¶t| d¡d d }dd||f||d f|fV | }|tjtjfkrÎ|}||||f|| f| fV |}qW dS ) aB Return all physical tokens, even line continuations. tokenize.generate_tokens() doesn't return a token for the backslash that continues lines. This wrapper provides those tokens so that we can re-create a faithful representation of the original source. Returns the same values as generate_tokens() Néÿÿÿÿz\ Tú\FÚ é r éþÿÿÿi é )ÚendswithÚtokenÚSTRINGÚsplitÚlenÚtokenizeÚNEWLINEÚNL) ÚtoksÚ last_lineZlast_linenoZ last_ttextÚttypeÚttextZslinenoÚscolZelinenoÚecolZltextZinject_backslashZccol© r ú/build/wlanpi-profiler-MIf3Xw/wlanpi-profiler-1.0.8/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/phystokens.pyÚphys_tokens s, r Úunicode)Úsourcec c s2 t jt jt jtjh}g }d}| d¡ dd¡} t| }xêt |D ]Þ\}}\}}\}} }d} xºt d|¡D ]ª}|dkr|V g }d}d}n|dkrd}nx||kr¤d}nj| rÊ||krÊ| d d || f¡ d} tj |d¡ ¡ dd } |t jkrüt |¡rüd} | | |f¡ d}d}qhW |r@| }q@W |r.|V dS )a Generate a series of lines, one for each line in `source`. Each line is a list of pairs, each pair is a token:: [('key', 'def'), ('ws', ' '), ('nam', 'hello'), ('op', '('), ... ] Each pair has a token class, and the token text. If you concatenate all the token texts, and then join them with newlines, you should have your original `source` back, with two differences: trailing whitespace is not preserved, and a final line with no newline is indistinguishable from a final line with a newline. r é z r Tz( )FÚ Úwsú ZxxNé Úkey)r ÚINDENTÚDEDENTr r r Ú expandtabsÚreplaceÚgenerate_tokensr Úrer ÚappendÚtok_nameÚgetÚlowerÚNAMEÚkeywordÚ iskeyword)r Z ws_tokensÚlineÚcolZtokgenr r Ú_r r Z mark_startÚpartZmark_endZ tok_classr r r Úsource_token_linesI s<