b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / lib2to3 / pgen2 /
Filename/usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyc
Size16.63 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed20-Jun-2019 19:45
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc*@sdZdZdZddkZddkZddklZlZddkTddk l
Z
gZ e e
�D]"Z
e
d d
jo e e
qkqk[ d d d
gZ[
yeWnej
o
eZnXd�Zd�Zd�ZdZdZeede�ee�ZdZdZdZdZdZeeeee�ZdZedd�ee�ZdeZ eee �Z!ede!d�Z"ee"e!e�Z#dZ$d Z%d!Z&d"Z'ed#d$�Z(ed%d&�Z)ed'd(d)d*d+d,d-d.d/� Z*d0Z+ed1d2�Z,ee*e+e,�Z-ee#e-e)e�Z.ee.Z/ed3ed4d�d5ed6d��Z0edee(�Z1eee1e#e-e0e�Z2e3ei4e/e2e&e'f�\Z5Z6Z7Z8h&ei4e$�d46ei4e%�d66e7d76e8d86e7d96e8d:6e7d;6e8d<6e7d=6e8d>6e7d?6e8d@6e7dA6e8dB6e7dC6e8dD6e7dE6e8dF6e7dG6e8dH6e7dI6e8dJ6e7dK6e8dL6e7dM6e8dN6e7dO6e8dP6e7dQ6e8dR6e7dS6e8dT6ddU6ddV6ddW6ddX6ddY6ddZ6Z:hZ;xd�D]Z<e<e;e<<qïWhZ=xd�D]Z<e<e=e<<qWdwZ>dxe?fdy��YZ@dze?fd{��YZAd|�ZBeBd}�ZCd~�ZDdd�d���YZEei4d��ZFd��ZGd��ZHd��ZId��ZJeKd�joTddkLZLeMeLiN�djoeCeOeLiNd�iP�qeCeLiQiP�ndS(�sÀTokenization help for Python programs.

generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line of input (or "" for EOF). It generates
5-tuples with these members:

the token type (see token.py)
the token (a string)
the starting (row, column) indices of the token (a 2-tuple of ints)
the ending (row, column) indices of the token (a 2-tuple of ints)
the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators

Older entry points
tokenize_loop(readline, tokeneater)
tokenize(readline, tokeneater=printtoken)
are the same, except instead of generating tokens, tokeneater is a callback
function to which the 5 fields described above are passed as 5 arguments,
each time a new token is found.sKa-Ping Yee <[email protected]>s@GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip MontanaroiÿÿÿÿN(tBOM_UTF8tlookup(t*i(ttokenit_ttokenizetgenerate_tokenst
untokenizecGsddi|�dS(Nt(t|t)(tjoin(tchoices((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pytgroup0scGst|�dS(NR(R
(R ((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pytany1scGst|�dS(Nt?(R
(R ((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pytmaybe2ss[ \f\t]*s #[^\r\n]*s\\\r?\ns [a-zA-Z_]\w*s
0[bB][01]*s0[xX][\da-fA-F]*[lL]?s0[oO]?[0-7]*[lL]?s
[1-9]\d*[lL]?s [eE][-+]?\d+s\d+\.\d*s\.\d+s\d+s\d+[jJ]s[jJ]s[^'\\]*(?:\\.[^'\\]*)*'s[^"\\]*(?:\\.[^"\\]*)*"s%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''s%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""s[ubUB]?[rR]?'''s[ubUB]?[rR]?"""s&[uU]?[rR]?'[^\n'\\]*(?:\\.[^\n'\\]*)*'s&[uU]?[rR]?"[^\n"\\]*(?:\\.[^\n"\\]*)*"s\*\*=?s>>=?s<<=?s<>s!=s//=?s->s[+\-*/%&|^=<>]=?t~s[][(){}]s\r?\ns[:;.,`@]s'[uUbB]?[rR]?'[^\n'\\]*(?:\\.[^\n'\\]*)*t's'[uUbB]?[rR]?"[^\n"\\]*(?:\\.[^\n"\\]*)*t"s'''s"""sr'''sr"""su'''su"""sb'''sb"""sur'''sur"""sbr'''sbr"""sR'''sR"""sU'''sU"""sB'''sB"""suR'''suR"""sUr'''sUr"""sUR'''sUR"""sbR'''sbR"""sBr'''sBr"""sBR'''sBR"""trtRtutUtbtBsr'sr"sR'sR"su'su"sU'sU"sb'sb"sB'sB"sur'sur"sUr'sUr"suR'suR"sUR'sUR"sbr'sbr"sBr'sBr"sbR'sbR"sBR'sBR"it
TokenErrorcBseZRS((t__name__t
__module__(((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyR�stStopTokenizingcBseZRS((RR(((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyR�sc CsA|\}}|\}}d||||t|t|�fGHdS(Ns%d,%d-%d,%d: %s %s(ttok_nametrepr( ttypeRtstarttendtlinetsrowtscolterowtecol((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyt
printtoken�s  cCs+yt||�Wntj
onXdS(s:
The tokenize() function accepts two parameters: one representing the
input stream, and one providing an output mechanism for tokenize().

The first parameter, readline, must be a callable object which provides
the same interface as the readline() method of built-in file objects.
Each call to the function should return one line of input as a string.

The second parameter, tokeneater, must also be a callable object. It is
called once for each token, with five arguments, corresponding to the
tuples generated by generate_tokens().
N(t
tokenize_loopR(treadlinet
tokeneater((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyR s
cCs%xt|�D]}||�q
WdS(N(R(R*R+t
token_info((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyR)³s
t UntokenizercBs,eZd�Zd�Zd�Zd�ZRS(cCsg|_d|_d|_dS(Nii(ttokenstprev_rowtprev_col(tself((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyt__init__¹s  cCsS|\}}||ijpt�||i}|o|iid|�ndS(Nt (R/tAssertionErrorR0R.tappend(R1R!trowtcolt
col_offset((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pytadd_whitespace¾s
 
cCs¼x©|D]¡}t|�djo|i||�Pn|\}}}}}|i|�|ii|�|\|_|_|ttfjo|id7_d|_qqWdi |i�S(Niiit(
tlentcompatR9R.R5R/R0tNEWLINEtNLR (R1titerablettttok_typeRR!R"R#((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyRÅs
c Cs4t}g}|ii}|\}}|ttfjo|d7}n|ttfjo
t}nxË|D]Ã}|d \}}|ttfjo|d7}n|tjo|i|�qinb|t jo|i
�qinD|ttfjo
t}n'|o|o||d�t}n||�qiWdS(NR3iiÿÿÿÿ( tFalseR.R5tNAMEtNUMBERR=R>tTruetINDENTtDEDENTtpop( R1RR?t startlinetindentst toks_appendttoknumttokvalttok((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyR<Ós2  






(RRR2R9RR<(((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyR-·s   scoding[:=]\s*([-\w.]+)cCsd|d i�idd�}|djp|id�odS|d jp|id
�odS|S(s(Imitates get_normal_name in tokenizer.c.i Rt-sutf-8sutf-8-slatin-1s
iso-8859-1s iso-latin-1slatin-1-s iso-8859-1-s iso-latin-1-(slatin-1s
iso-8859-1s iso-latin-1(slatin-1-s iso-8859-1-s iso-latin-1-(tlowertreplacet
startswith(torig_enctenc((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyt_get_normal_nameñs
csèt�d}d}�fd�}�fd�}|�}|it�ot�|d}d}n|p |gfS||�}|o||gfS|�}|p||gfS||�}|o|||gfS|||gfS(s
The detect_encoding() function is used to detect the encoding that should
be used to decode a Python source file. It requires one argment, readline,
in the same way as the tokenize() generator.

It will call readline a maximum of twice, and return the encoding used
(as a string) and a list of any lines (left as bytes) it has read
in.

It detects the encoding from the presence of a utf-8 bom or an encoding
cookie as specified in pep-0263. If both a bom and a cookie are present, but
disagree, a SyntaxError will be raised. If the encoding cookie is an invalid
charset, raise a SyntaxError. Note that if a utf-8 bom is found,
'utf-8-sig' is returned.

If no encoding is specified, then the default of 'utf-8' will be returned.
sutf-8cs)y ��SWntj
o t�SXdS(N(t
StopIterationtbytes((R*(s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyt read_or_stops csÄy|id�}Wntj
odSXti|�}|pdSt|d�}yt|�}Wn#tj
otd|��nX�o.|i djotd��n|d7}n|S(Ntasciiisunknown encoding: sutf-8sencoding problem: utf-8s-sig(
tdecodetUnicodeDecodeErrortNonet cookie_retfindallRURt LookupErrort SyntaxErrortname(R#t line_stringtmatchestencodingtcodec(t bom_found(s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyt find_cookies"is utf-8-sigN(RBR\RRRRE(R*RdtdefaultRXRgtfirsttsecond((RfR*s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pytdetect_encodingüs, 

    cCst�}|i|�S(s¬Transform tokens back into Python source code.

Each element returned by the iterable must be a token sequence
with at least two elements, a token number and token value. If
only two tokens are passed, the resulting output is poor.

Round-trip invariant for full input:
Untokenized source will match input source exactly

Round-trip invariant for limited intput:
# Output text will tokenize the back to the input
t1 = [tok[:2] for tok in generate_tokens(f.readline)]
newcode = untokenize(t1)
readline = iter(newcode.splitlines(1)).next
t2 = [tok[:2] for tokin generate_tokens(readline)]
assert t1 == t2
(R-R(R?tut((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyRDs c cs d}}}tidd}}d\}}d}dg} xy
|�}
Wntj
o
d}
nX|d}dt|
�} } |oú|
ptd|
f�n|i|
�}|oO|id�} }t||
| |
||f||
fVd\}}d}q|oY|
ddjoH|
d d
jo7t ||
|
|t|
�f|fVd}d}q@q||
}||
}q@n||djoH| o@|
pPnd}x~| | jop|
| d jo|d}nD|
| d jo|t
dt
}n|
| d
jo
d}nP| d} q±W| | joPn|
| djoÑ|
| djo{|
| i d�}| t|�}t ||| f|| t|�f|
fVt
|
|||f|t|
�f|
fVq@t
t f|
| dj|
| || f|t|
�f|
fVq@n|| djo5| i|�t|
| |df|| f|
fVnx�|| djoZ|| jotdd|| |
f��n| d } td|| f|| f|
fVqlWn'|
ptd|dff�nd}x?| | jo1ti|
| �}|oâ|id�\}}||f||f|}}} |
||!|
|}}||jp|djo%|djot||||
fVq?|djo5t}|djo
t
}n|||||
fVq?|djo0|id� pt�t ||||
fVq?|tjo~t|}|i|
| �}|o:|id�} |
|| !}t|||| f|
fVq ||f}
|
|}|
}Pq?|tjp"|d tjp|d tjoy|ddjoP||f}
t|pt|dp t|d}|
|d}}|
}Pq t||||
fVq?||jot||||
fVq?|djo$t
|||| f|
fVd}q?|djo|d}n|djo|d}nt||||
fVqt |
| || f|| df|
fV| d} qWq@x2| dD]&}td|df|dfdfVqRWtd|df|dfdfVdS(sS
The generate_tokens() generator requires one argment, readline, which
must be a callable object which provides the same interface as the
readline() method of built-in file objects. Each call to the function
should return one line of input as a string. Alternately, readline
can be a callable function terminating with StopIteration:
readline = open(myfile).next # Example of alternate readline

The generator produces 5-tuples with these members: the token type; the
token string; a 2-tuple (srow, scol) of ints specifying the row and
column where the token begins in the source; a 2-tuple (erow, ecol) of
ints specifying the row and column where the token ends in the source;
and the line on which the token was found. The line passed is the
logical line; continuation lines are included.
iRt
0123456789R:isEOF in multi-line stringiþÿÿÿs\
iýÿÿÿs\
R3s s s#
t#s
iÿÿÿÿs3unindent does not match any outer indentation levels
<tokenize>sEOF in multi-line statementt.s
iis\s([{s)]}N(R:i(R:i(tstringt
ascii_lettersR\RVR;RtmatchR"tSTRINGt
ERRORTOKENttabsizetrstriptCOMMENTR>R5RFtIndentationErrorRGt
pseudoprogtspanRDR=tendswithR4t
triple_quotedtendprogst
single_quotedRCtOPt ENDMARKER(R*tlnumtparenlevt continuedt namecharstnumcharstcontstrtneedconttcontlineRJR#tpostmaxtstrstarttendprogtendmatchR"tcolumnt
comment_tokentnl_post pseudomatchR!tsposteposRtinitialtnewlinetindent((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyRYs  
 
 
)





$
$ 
(

)
 







 

 





 $t__main__(s'''s"""sr'''sr"""sR'''sR"""su'''su"""sU'''sU"""sb'''sb"""sB'''sB"""sur'''sur"""sUr'''sUr"""suR'''suR"""sUR'''sUR"""sbr'''sbr"""sBr'''sBr"""sbR'''sbR"""sBR'''sBR"""(RRsr'sr"sR'sR"su'su"sU'sU"sb'sb"sB'sB"sur'sur"sUr'sUr"suR'suR"sUR'sUR"sbr'sbr"sBr'sBr"sbR'sbR"sBR'sBR"((Rt__doc__t
__author__t __credits__RptretcodecsRRtlib2to3.pgen2.tokenR:Rt_[1]tdirtxt__all__RWt NameErrortstrR
RRt
WhitespacetCommenttIgnoretNamet Binnumbert Hexnumbert Octnumbert Decnumbert IntnumbertExponentt
PointfloattExpfloatt Floatnumbert
ImagnumbertNumbertSingletDoubletSingle3tDouble3tTripletStringtOperatortBrackettSpecialtFunnyt
PlainTokentTokentContStrt PseudoExtrast PseudoTokentmaptcompilet tokenprogRyt single3progt double3progR\R}R|R@R~Rut ExceptionRRR(RR)R-R]RURkRRRtsysR;targvtopenR*tstdin(((s./usr/lib64/python2.6/lib2to3/pgen2/tokenize.pyt<module>sâ
<
    
  

'#   8 H  �