tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
Y\¬Qc@s dZdZdZddlZddlZddlmZmZddlTddl    m
Z
ge e
ƒD]Z e d    d
krge ^qgd d d gZ [
yeWnek
rºeZnXd„Zd„Zd„ZdZdZeedeƒeeƒZdZdZdZdZdZeeeeeƒZdZeddƒeeƒZdeZeeeƒ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ƒƒZ/edee'ƒZ0eee0e"e,e/eƒZ1e2ej3e.e1e%e&fƒ\Z4Z5Z6Z7i&ej3e#ƒd46ej3e$ƒd66e6d76e7d86e6d96e7d:6e6d;6e7d<6e6d=6e7d>6e6d?6e7d@6e6dA6e7dB6e6dC6e7dD6e6dE6e7dF6e6dG6e7dH6e6dI6e7dJ6e6dK6e7dL6e6dM6e7dN6e6dO6e7dP6e6dQ6e7dR6e6dS6e7dT6ddU6ddV6ddW6ddX6ddY6ddZ6Z9iZ:xd‡D]Z;e;e:e;<qàWiZ<xdˆD]Z;e;e<e;<qWdwZ=dxe>fdy„ƒYZ?dze>fd{„ƒYZ@d|„ZAeAd}„ZBd~„ZCdd‰d€„ƒYZDej3dƒZEd‚„ZFdƒ„ZGd„„ZHd…„ZIeJd†krddlKZKeLeKjMƒdkrõeBeNeKjMdƒjOƒqeBeKjPjOƒ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 <ping@lfw.org>s@GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip MontanaroiÿÿÿÿN(tBOM_UTF8tlookup(t*i(ttokenit_ttokenizetgenerate_tokenst
untokenizecGsddj|ƒdS(Nt(t|t)(tjoin(tchoices((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pytgroup0scGst|ŒdS(NR(R (R ((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pytany1scGst|ŒdS(Nt?(R (R ((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/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^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyR–stStopTokenizingcBseZRS((RR(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyR˜sc    CsA|\}}|\}}d||||t|t|ƒfGHdS(Ns%d,%d-%d,%d:    %s    %s(ttok_nametrepr(    ttypeRtstarttendtlinetsrowtscolterowtecol((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyt
printtokenšs  cCs)yt||ƒWntk
r$nXdS(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^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyR s  cCs%xt|ƒD]}||Œq WdS(N(R(R*R+t
token_info((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyR)³st UntokenizercBs,eZd„Zd„Zd„Zd„ZRS(cCsg|_d|_d|_dS(Nii(ttokenstprev_rowtprev_col(tself((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyt__init__¹s        cCsO|\}}||jks!t‚||j}|rK|jjd|ƒndS(Nt (R/tAssertionErrorR0R.tappend(R1R!trowtcolt
col_offset((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pytadd_whitespace¾s
  cCs¸x¥|D]}t|ƒdkr3|j||ƒPn|\}}}}}|j|ƒ|jj|ƒ|\|_|_|ttfkr|jd7_d|_qqWdj    |jƒS(Niiit(
tlentcompatR9R.R5R/R0tNEWLINEtNLR (R1titerablettttok_typeRR!R"R#((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyRÅs  c    Cs%t}g}|jj}|\}}|ttfkrC|d7}n|ttfkr^t}nxÀ|D]¸}|d \}}|ttfkrš|d7}n|tkr¹|j|ƒqenZ|t    krÕ|j
ƒqen>|ttfkrðt}n#|r|r||dƒt}n||ƒqeWdS(NR3iiÿÿÿÿ( tFalseR.R5tNAMEtNUMBERR=R>tTruetINDENTtDEDENTtpop(    R1RR?t    startlinetindentst toks_appendttoknumttokvalttok((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyR<Ós0            
         (RRR2R9RR<(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyR-·s            scoding[:=]\s*([-\w.]+)cCs^|d jƒjddƒ}|dks7|jdƒr;dS|d ksV|jd ƒrZdS|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^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyt_get_normal_nameñs csÞt‰d}d}‡fd†}‡fd†}|ƒ}|jtƒrat‰|d}d}n|sq|gfS||ƒ}|r||gfS|ƒ}|s¬||gfS||ƒ}|rÎ|||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 ˆƒSWntk
r"tƒSXdS(N(t StopIterationtbytes((R*(s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyt read_or_stops  csºy|jdƒ}Wntk
r'dSXtj|ƒ}|sAdSt|dƒ}yt|ƒ}Wn!tk
r„td|ƒ‚nXˆr¶|j    dkr©tdƒ‚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^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyt find_cookies"   is    utf-8-sigN(RBR\RRRRE(R*RdtdefaultRXRgtfirsttsecond((RfR*s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pytdetect_encodingüs,    
    
        cCstƒ}|j|ƒ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^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyRDs    c
csUd}}}tjdd}}d\}}d}dg}    x¼y |ƒ}
Wntk
rfd}
nX|d}dt|
ƒ} } |r{|
s¢td| f‚n|j|
ƒ}|r|jdƒ} }t||
| | ||f||
fVd\}}d}qÛ|ra|
ddkra|
d    d
krat    ||
| |t|
ƒf|fVd}d}q@qÛ||
}||
}q@n`|dkr·| r·|
s˜Pnd}xv| | kr|
| d krÊ|d}n?|
| d krï|t
dt
}n|
| d krd}nP| d} q¡W| | kr'Pn|
| dkr|
| dkrÁ|
| j dƒ}| t|ƒ}t ||| f|| t|ƒf|
fVt |
|||f|t|
ƒf|
fVq@t t f|
| dk|
| || f|t|
ƒf|
fVq@n||    dkrI|    j|ƒt|
|  |df|| f|
fVnx||    dkr³||    kr†tdd|| |
fƒ‚n|    d }    td|| f|| f|
fVqLWn$|
sÕtd|dff‚nd}x| | krøtj|
| ƒ}|rÃ|jdƒ\}}||f||f|}}} |
||!|
|}}||kss|dkrŠ|dkrŠt||||
fVqõ|dkrÈt}|dkr±t }n|||||
fVqõ|dkr|jdƒ sêt‚t ||||
fVqõ|tkrˆt|}|j|
| ƒ}|rh|jdƒ} |
|| !}t|||| f|
fVqÀ||f} |
|}|
}Pqõ|tks´|d tks´|d tkr(|ddkr||f} t|pót|dpót|d}|
|d}}|
}PqÀt||||
fVqõ||krKt||||
fVqõ|dkrzt |||| f|
fVd}qõ|dkr“|d}n|dkr¬|d}nt||||
fVqÞt    |
| || f|| df|
fV| d} qÞWq@x2|    dD]&}td|df|dfdfVqWtd|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^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/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"((Qt__doc__t
__author__t __credits__RptretcodecsRRtlib2to3.pgen2.tokenR:Rtdirtxt__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^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pgen2/tokenize.pyt<module>sÞ
/  
            
        
 '#
 
         8        H        ˜