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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
X\¬Qc@sdZdZddlZddlZddlmZdZiad„Zdefd„ƒYZ    d    e    fd
„ƒYZ
d e    fd „ƒYZ d „Z defd„ƒYZ de fd„ƒYZde fd„ƒYZde fd„ƒYZde fd„ƒYZd„ZdS(sÌ
Python parse tree definitions.
 
This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.
 
There's also a pattern matching implementation here.
s#Guido van Rossum <guido@python.org>iÿÿÿÿN(tStringIOiÿÿÿcCshtsXddlm}x?|jjƒD]+\}}t|ƒtkr&|t|<q&q&Wntj||ƒS(Ni(tpython_symbols(t _type_reprstpygramRt__dict__titemsttypetintt
setdefault(ttype_numRtnametval((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt    type_reprs tBasecBsûeZdZdZdZdZeZeZ    d„Z
d„Z dZ d„Z d„Zd„Zd„Zd„Zd„Zd    „Zd
„Zd „Zd „Zd „Zed„ƒZed„ƒZd„Zd„Zd„Zejdkrùd„Z nRS(sÂ
    Abstract base class for Node and Leaf.
 
    This provides some default functionality and boilerplate using the
    template pattern.
 
    A node may be a subnode of at most one parent.
    cOs tj|ƒS(s7Constructor that prevents Base from being instantiated.(tobjectt__new__(tclstargstkwds((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR2scCs#|j|jk    rtS|j|ƒS(sW
        Compare two nodes for equality.
 
        This calls the method _eq().
        (t    __class__tNotImplementedt_eq(tselftother((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt__eq__7scCs$|j|jk    rtS|j|ƒ S(sY
        Compare two nodes for inequality.
 
        This calls the method _eq().
        (RRR(RR((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt__ne__CscCs
t‚dS(s_
        Compare two nodes for equality.
 
        This is called by __eq__ and __ne__.  It is only called if the two nodes
        have the same type.  This must be implemented by the concrete subclass.
        Nodes should be considered equal if they have the same structure,
        ignoring the prefix string and other context information.
        N(tNotImplementedError(RR((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRMs    cCs
t‚dS(sr
        Return a cloned (deep) copy of self.
 
        This must be implemented by the concrete subclass.
        N(R(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pytcloneXscCs
t‚dS(sx
        Return a post-order iterator for the tree.
 
        This must be implemented by the concrete subclass.
        N(R(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt
post_order`scCs
t‚dS(sw
        Return a pre-order iterator for the tree.
 
        This must be implemented by the concrete subclass.
        N(R(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt    pre_orderhscCs#tjdtddƒ||_dS(sv
        Set the prefix for the node (see Leaf class).
 
        DEPRECATED; use the prefix property directly.
        s3set_prefix() is deprecated; use the prefix propertyt
stackleveliN(twarningstwarntDeprecationWarningtprefix(RR"((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt
set_prefixps     cCstjdtddƒ|jS(sy
        Return the prefix for the node (see Leaf class).
 
        DEPRECATED; use the prefix property directly.
        s3get_prefix() is deprecated; use the prefix propertyRi(RR R!R"(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt
get_prefixzs     cCs¿t|tƒs|g}ng}t}xR|jjD]D}||krk|dk    rb|j|ƒnt}q4|j|ƒq4W|jj    ƒ||j_x|D]}|j|_qœWd|_dS(s/Replace this node with a new one in the parent.N(
t
isinstancetlisttFalsetparenttchildrentNonetextendtTruetappendtchanged(Rtnewt
l_childrentfoundtchtx((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pytreplace„s          cCs=|}x-t|tƒs5|js%dS|jd}q    W|jS(s9Return the line number which generated the invocant node.Ni(R%tLeafR)tlineno(Rtnode((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt
get_lineno›s     cCs&|jr|jjƒnt|_dS(N(R(R.R,t was_changed(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR.¤s    cCsf|jrbxVt|jjƒD]?\}}||kr|jjƒ|jj|=d|_|SqWndS(s‰
        Remove the node from the tree. Returns the position of the node in its
        parent's children before it was removed.
        N(R(t    enumerateR)R.R*(RtiR7((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pytremove©s           cCst|jdkrdSxZt|jjƒD]F\}}||kr&y|jj|dSWqltk
rhdSXq&q&WdS(sŸ
        The node immediately following the invocant in their parent's children
        list. If the invocant does not have a next sibling, it is None
        iN(R(R*R:R)t
IndexError(RR;tchild((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt next_sibling¶s  cCsh|jdkrdSxNt|jjƒD]:\}}||kr&|dkrNdS|jj|dSq&WdS(s¤
        The node immediately preceding the invocant in their parent's children
        list. If the invocant does not have a previous sibling, it is None.
        iiN(R(R*R:R)(RR;R>((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt prev_siblingÇs  ccs4x-|jD]"}x|jƒD] }|VqWq
WdS(N(R)tleaves(RR>R3((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRA×scCs$|jdkrdSd|jjƒS(Nii(R(R*tdepth(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRBÜscCs |j}|dkrdS|jS(s
        Return the string immediately following the invocant node. This is
        effectively equivalent to node.next_sibling.prefix
        uN(R?R*R"(Rtnext_sib((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt
get_suffixás     iicCst|ƒjdƒS(Ntascii(tunicodetencode(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt__str__ìsN((ii(!t__name__t
__module__t__doc__R*RR(R)R'R9t was_checkedRRt__hash__RRRRRR#R$R4R8R.R<tpropertyR?R@RARBRDtsyst version_infoRH(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR  s6            
    
                   
   
                                
tNodecBsªeZdZdddd„Zd„Zd„ZejdkrHeZ    nd„Z
d„Z d„Z d    „Z d
„Zd „ZeeeƒZd „Zd „Zd„ZRS(s+Concrete implementation for interior nodes.cCsm||_t|ƒ|_x|jD]}||_q"W|dk    rM||_n|r`||_n    d|_dS(sð
        Initializer.
 
        Takes a type constant (a symbol number >= 256), a sequence of
        child nodes, and an optional context keyword argument.
 
        As a side effect, the parent pointers of the children are updated.
        N(RR&R)R(R*R"tfixers_applied(RRR)tcontextR"RRR2((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt__init__ós        cCs#d|jjt|jƒ|jfS(s)Return a canonical string representation.s
%s(%s, %r)(RRIR RR)(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt__repr__ s  cCsdjtt|jƒƒS(sk
        Return a pretty string representation.
 
        This reproduces the input source exactly.
        u(tjointmapRFR)(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt __unicode__siicCs"|j|jf|j|jfkS(sCompare two nodes for equality.(RR)(RR((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRscCs5t|jg|jD]}|jƒ^qd|jƒS(s$Return a cloned (deep) copy of self.RR(RQRR)RRR(RR2((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR!s+ccs9x-|jD]"}x|jƒD] }|VqWq
W|VdS(s*Return a post-order iterator for the tree.N(R)R(RR>R7((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR&s ccs9|Vx-|jD]"}x|jƒD] }|Vq"WqWdS(s)Return a pre-order iterator for the tree.N(R)R(RR>R7((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR-scCs|js dS|jdjS(sO
        The whitespace and comments preceding this node in the input.
        ti(R)R"(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt_prefix_getter4s    cCs |jr||jd_ndS(Ni(R)R"(RR"((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt_prefix_setter<s    cCs4||_d|j|_||j|<|jƒdS(s…
        Equivalent to 'node.children[i] = child'. This method also sets the
        child's parent attribute appropriately.
        N(R(R*R)R.(RR;R>((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt    set_childBs     cCs*||_|jj||ƒ|jƒdS(s‹
        Equivalent to 'node.children.insert(i, child)'. This method also sets
        the child's parent attribute appropriately.
        N(R(R)tinsertR.(RR;R>((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt insert_childLs    cCs'||_|jj|ƒ|jƒdS(sˆ
        Equivalent to 'node.children.append(child)'. This method also sets the
        child's parent attribute appropriately.
        N(R(R)R-R.(RR>((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt append_childUs    N(ii(RIRJRKR*RTRURXRORPRHRRRRRZR[RNR"R\R^R_(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRQïs$                                         
       R5cBsªeZdZdZdZdZddgd„Zd„Zd„Z    e
j dkrZe    Z nd„Z d„Zd    „Zd
„Zd „Zd „Zd „ZeeeƒZRS(s'Concrete implementation for leaf nodes.RYicCsb|dk    r*|\|_\|_|_n||_||_|dk    rT||_n||_dS(s—
        Initializer.
 
        Takes a type constant (a token number < 256), a string value, and an
        optional context keyword argument.
        N(R*t_prefixR6tcolumnRtvalueRR(RRRbRSR"RR((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRThs           cCsd|jj|j|jfS(s)Return a canonical string representation.s
%s(%r, %r)(RRIRRb(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRU{s cCs|jt|jƒS(sk
        Return a pretty string representation.
 
        This reproduces the input source exactly.
        (R"RFRb(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRXsicCs"|j|jf|j|jfkS(sCompare two nodes for equality.(RRb(RR((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRŒscCs4t|j|j|j|j|jffd|jƒS(s$Return a cloned (deep) copy of self.RR(R5RRbR"R6RaRR(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRsccs    |VdS(N((R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRA–sccs    |VdS(s*Return a post-order iterator for the tree.N((R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR™sccs    |VdS(s)Return a pre-order iterator for the tree.N((R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRscCs|jS(sP
        The whitespace and comments preceding this token in the input.
        (R`(R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRZ¡scCs|jƒ||_dS(N(R.R`(RR"((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR[§s
N(ii(RIRJRKR`R6RaR*RTRURXRORPRHRRRARRRZR[RNR"(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR5_s&                                         cCsk|\}}}}|s'||jkrTt|ƒdkrA|dSt||d|ƒSt||d|ƒSdS(sõ
    Convert raw node information to a Node or Leaf instance.
 
    This is passed to the parser driver which calls it whenever a reduction of a
    grammar rule produces a new complete node, so that the tree is build
    strictly bottom-up.
    iiRSN(t number2symboltlenRQR5(tgrtraw_nodeRRbRSR)((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pytconvert­s t BasePatterncBs\eZdZdZdZdZd„Zd„Zd„Z    dd„Z
dd„Z d„Z RS(s”
    A pattern is a tree matching pattern.
 
    It looks for a specific node type (token or symbol), and
    optionally for a specific content.
 
    This is an abstract base class.  There are three concrete
    subclasses:
 
    - LeafPattern matches a single leaf node;
    - NodePattern matches a single node (usually non-leaf);
    - WildcardPattern matches a sequence of nodes of variable length.
    cOs tj|ƒS(s>Constructor that prevents BasePattern from being instantiated.(RR(RRR((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRÕscCsht|jƒ|j|jg}x!|rA|ddkrA|d=q!Wd|jjdjtt    |ƒƒfS(Niÿÿÿÿs%s(%s)s, (
R RtcontentR
R*RRIRVRWtrepr(RR((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRUÚs cCs|S(sŒ
        A subclass can define this as a hook for optimizations.
 
        Returns either self or another node with the same effect.
        ((R((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pytoptimizeàscCs§|jdk    r%|j|jkr%tS|jdk    r~d}|dk    rOi}n|j||ƒsetS|r~|j|ƒq~n|dk    r£|jr£|||j<ntS(s#
        Does this pattern exactly match a node?
 
        Returns True if it matches, False if not.
 
        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.
 
        Default implementation for non-wildcard patterns.
        N(RR*R'Rit    _submatchtupdateR
R,(RR7tresultstr((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pytmatchès !     cCs*t|ƒdkrtS|j|d|ƒS(s
        Does this pattern exactly match a sequence of nodes?
 
        Default implementation for non-wildcard patterns.
        ii(RdR'Rp(RtnodesRn((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt    match_seqsccs4i}|r0|j|d|ƒr0d|fVndS(s}
        Generator yielding all matches for this pattern.
 
        Default implementation for non-wildcard patterns.
        iiN(Rp(RRqRo((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pytgenerate_matches sN( RIRJRKR*RRiR
RRURkRpRrRs(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRhÀs             
t LeafPatterncBs2eZdddd„Zdd„Zdd„ZRS(cCs=|dk    rn|dk    rn||_||_||_dS(sp
        Initializer.  Takes optional type, content, and name.
 
        The type, if given must be a token type (< 256).  If not given,
        this matches any *leaf* node; the content may still be required.
 
        The content, if given, must be a string.
 
        If a name is given, the matching node is stored in the results
        dict under that key.
        N(R*RRiR
(RRRiR
((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRTs          cCs&t|tƒstStj|||ƒS(s*Override match() to insist on a leaf node.(R%R5R'RhRp(RR7Rn((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRp,scCs|j|jkS(s„
        Match the pattern's content to the node's children.
 
        This assumes the node type matches and self.content is not None.
 
        Returns True if it matches, False if not.
 
        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.
 
        When returning False, the results dict may still be updated.
        (RiRb(RR7Rn((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRl2s N(RIRJR*RTRpRl(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRts t NodePatterncBs,eZeZdddd„Zdd„ZRS(cCs|dk    rn|dk    rbt|ƒ}x8t|ƒD]'\}}t|tƒr4t|_q4q4Wn||_||_||_    dS(sd
        Initializer.  Takes optional type, content, and name.
 
        The type, if given, must be a symbol type (>= 256).  If the
        type is None this matches *any* single node (leaf or not),
        except if content is not None, in which it only matches
        non-leaf nodes that also match the content pattern.
 
        The content, if not None, must be a sequence of Patterns that
        must match the node's children exactly.  If the content is
        given, the type must not be None.
 
        If a name is given, the matching node is stored in the results
        dict under that key.
        N(
R*R&R:R%tWildcardPatternR,t    wildcardsRRiR
(RRRiR
R;titem((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRTFs           cCsÊ|jrhxXt|j|jƒD]A\}}|t|jƒkr|dk    r\|j|ƒntSqWtSt|jƒt|jƒkrŠtSx9t    |j|jƒD]"\}}|j
||ƒs tSq WtS(s„
        Match the pattern's content to the node's children.
 
        This assumes the node type matches and self.content is not None.
 
        Returns True if it matches, False if not.
 
        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.
 
        When returning False, the results dict may still be updated.
        N( RwRsRiR)RdR*RmR,R'tzipRp(RR7RntcRot
subpatternR>((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRlcs    " "N(RIRJR'RwR*RTRl(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRuBsRvcBsheZdZd
ded
d„Zd„Zd
d„Zd
d„Zd„Z    d„Z
d„Z d    „Z RS( s
    A wildcard pattern can match zero or more nodes.
 
    This has all the flexibility needed to implement patterns like:
 
    .*      .+      .?      .{m,n}
    (a b c | d e | f)
    (...)*  (...)+  (...)?  (...){m,n}
 
    except it always uses non-greedy matching.
    icCs]|dk    r5ttt|ƒƒ}x|D]}q(Wn||_||_||_||_dS(sÏ
        Initializer.
 
        Args:
            content: optional sequence of subsequences of patterns;
                     if absent, matches one node;
                     if present, each subsequence is an alternative [*]
            min: optional minimum number of times to match, default 0
            max: optional maximum number of times to match, default HUGE
            name: optional name assigned to this match
 
        [*] Thus, if content is [[a, b, c], [d, e], [f, g, h]] this is
            equivalent to (a b c | d e | f g h); if content is None,
            this is equivalent to '.' in regular expression terms.
            The min and max parameters work as follows:
                min=0, max=maxint: .*
                min=1, max=maxint: .+
                min=0, max=1: .?
                min=1, max=1: .
            If content is not None, replace the dot with the parenthesized
            list of alternatives, e.g. (a b c | d e | f g h)*
        N(R*ttupleRWRitmintmaxR
(RRiR}R~R
talt((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRTs              c Cs/d}|jdk    rWt|jƒdkrWt|jdƒdkrW|jdd}n|jdkr¿|jdkr¿|jdkr”td|jƒS|dk    r¿|j|jkr¿|jƒSn|jdkr+t|t    ƒr+|jdkr+|j|jkr+t    |j|j|j|j|j|jƒS|S(s+Optimize certain stacked wildcard patterns.iiR
N(
R*RiRdR}R~RuR
RkR%Rv(RR{((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRk°s . !      
cCs|j|g|ƒS(s'Does this pattern exactly match a node?(Rr(RR7Rn((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRpÃscCsuxn|j|ƒD]]\}}|t|ƒkr|dk    ri|j|ƒ|jrit|ƒ||j<qintSqWtS(s4Does this pattern exactly match a sequence of nodes?N(RsRdR*RmR
R&R,R'(RRqRnRzRo((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRrÇs      ccsŒ|jdkrsxvt|jdtt|ƒ|jƒƒD]4}i}|jra|| ||j<n||fVq8Wn|jdkr“|j|ƒVnõtt    dƒrºt    j
}t ƒt    _
nz¯yOxH|j |dƒD]4\}}|jrü|| ||j<n||fVqÓWWnYt k
rgxI|j|ƒD]4\}}|jrU|| ||j<n||fVq,WnXWdtt    dƒr‡|t    _
nXdS(s"
        Generator yielding matches for a sequence of nodes.
 
        Args:
            nodes: sequence of nodes
 
        Yields:
            (count, results) tuples where:
            count: the match comprises nodes[:count];
            results: dict containing named submatches.
        it    bare_namet getrefcountiN(RiR*txrangeR}RdR~R
t_bare_name_matchesthasattrROtstderrRt_recursive_matchest RuntimeErrort_iterative_matches(RRqtcountRot save_stderr((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRsÒs0 /                 c cs`t|ƒ}d|jkr)difVng}xO|jD]D}x;t||ƒD]*\}}||fV|j||fƒqOWq9WxØ|r[g}x¿|D]·\}}    ||kr—||jkr—x|jD]}xvt|||ƒD]a\}
} |
dkrâi}|j|    ƒ|j| ƒ||
|fV|j||
|fƒqâqâWqÈWq—q—W|}q„WdS(s(Helper to iteratively yield the matches.iN(RdR}RiRsR-R~Rm( RRqtnodelenRnRRzRot new_resultstc0tr0tc1tr1((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRˆÿs*          )cCs›d}i}t}t|ƒ}x_| r||krt}x?|jD]4}|dj|||ƒrD|d7}t}PqDqDWq!W|| ||j<||fS(s(Special optimized matcher for bare_name.ii(R'RdR,RiRpR
(RRqR‰RotdoneR~tleaf((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRƒs 
 c    csÁ||jkrdifVn||jkr½xŽ|jD]€}xwt||ƒD]f\}}xW|j|||dƒD];\}}i}|j|ƒ|j|ƒ|||fVqsWqLWq6WndS(s(Helper to recursively yield the matches.iiN(R}R~RiRsR†Rm(    RRqR‰RRRŽRRRo((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR†,s'  N( RIRJRKR*tHUGERTRkRpRrRsRˆRƒR†(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRvs #         -        tNegatedPatterncBs/eZdd„Zd„Zd„Zd„ZRS(cCs|dk    rn||_dS(s
        Initializer.
 
        The argument is either a pattern or None.  If it is None, this
        only matches an empty sequence (effectively '$' in regex
        lingo).  If it is not None, this matches whenever the argument
        pattern doesn't have any matches.
        N(R*Ri(RRi((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRT=s     cCstS(N(R'(RR7((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRpJscCst|ƒdkS(Ni(Rd(RRq((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRrNsccse|jdkr2t|ƒdkradifVqan/x!|jj|ƒD] \}}dSWdifVdS(Ni(RiR*RdRs(RRqRzRo((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRsRs N(RIRJR*RTRpRrRs(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyR”;s        c    cs´|sdifVnœ|d|d}}x„|j|ƒD]s\}}|sY||fVq9xPt|||ƒD];\}}i}|j|ƒ|j|ƒ|||fVqmWq9WdS(sR
    Generator yielding matches for a sequence of patterns and nodes.
 
    Args:
        patterns: a sequence of patterns
        nodes: a sequence of nodes
 
    Yields:
        (count, results) tuples where:
        count: the entire sequence of patterns matches nodes[:count];
        results: dict containing named submatches.
        iiN(RsRm(    tpatternsRqtptrestRRŽRRRo((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyRs^s    (RKt
__author__RORRR“RR RR RQR5RgRhRtRuRvR”Rs(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/pytree.pyt<module> s"      
ÏpN    V,=¼#