Ë èËQÇ·©%ãóê—dZdZddlZddlmZdZiad„ZGd„de«Z Gd „d e «Z Gd „d e «Z d „Z Gd„de«Z Gd„de «ZGd„de «ZGd„de «ZGd„de «Zd„Zy)zÌ 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. z#Guido van Rossum éN)ÚStringIOiÿÿÿcó—tsDddlm}|jj «D]!\}}t |«t k(sŒ|t|<Œ#tj||«S)Né)Úpython_symbols)Ú _type_reprsÚpygramrÚ__dict__ÚitemsÚtypeÚintÚ setdefault)Útype_numrÚnameÚvals ú%/usr/lib/python3.12/lib2to3/pytree.pyÚ type_reprrsO€å Ý*ð(×0Ñ0×6Ñ6Ö8‰IˆD�#Ü�C‹yœCÓ°D¤¨SÒ!1ð9ä × !Ñ ! (¨HÓ 5Ð5ócó¼—eZdZdZdZdZdZdZdZd„Z d„Z dZ d„Z d„Z d „Zd „Zd „Zd „Zd „Zd„Zed„«Zed„«Zd„Zd„Zd„Zej6dkrd„Zyy)ÚBasez 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. N©FcóJ—|tusJd«‚tj|«S)z7Constructor that prevents Base from being instantiated.zCannot instantiate Base)rÚobjectÚ__new__©ÚclsÚargsÚkwdss rrz Base.__new__1s#€àœ$‰Ð9Ð 9Ó9ˆÜ�~‰~˜cÓ"Ð"rcó`—|j|jurtS|j|«S)zW Compare two nodes for equality. This calls the method _eq(). )Ú __class__ÚNotImplementedÚ_eq©ÚselfÚothers rÚ__eq__z Base.__eq__6s(€ð �>‰> §¡Ñ 0Ü!Ð !Ø�x‰x˜‹Ðrcó—t‚)a_ 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. ©ÚNotImplementedErrorr"s rr!zBase._eqBs €ô"Ð!rcó—t‚)zr Return a cloned (deep) copy of self. This must be implemented by the concrete subclass. r'©r#s rÚclonez Base.cloneMó €ô "Ð!rcó—t‚)zx Return a post-order iterator for the tree. This must be implemented by the concrete subclass. r'r*s rÚ post_orderzBase.post_orderUr,rcó—t‚)zw Return a pre-order iterator for the tree. This must be implemented by the concrete subclass. r'r*s rÚ pre_orderzBase.pre_order]r,rcóþ—|j€Jt|««‚|€J‚t|t«s|g}g}d}|jjD]M}||ur6|rJ|jj||f«‚|�|j |«d}Œ=|j |«ŒO|sJ|j||f«‚|jj«||j_|D]}|j|_Œd|_y)z/Replace this node with a new one in the parent.NFT)ÚparentÚstrÚ isinstanceÚlistÚchildrenÚextendÚappendÚchanged)r#ÚnewÚ l_childrenÚfoundÚchÚxs rÚreplacez Base.replaceesñ€à�{‰{Ð&Ð1¬¨D« Ó1Ð&؈Јܘ#œtÔ$Ø�%ˆC؈ ؈ؗ+‘+×&Ô&ˆBØ�T‰zÙ ÐC 4§;¡;×#7Ñ#7¸¸sÐ"CÓC�yØ�?Ø×%Ñ% cÔ*Ø‘à×!Ñ! "Õ%ð'ñÐ0�t—}‘} d¨CÐ0Ó0ˆuØ � ‰ ×ÑÔØ)ˆ� ‰ ÔÛˆAØ—{‘{ˆA�Hðàˆ� rcó˜—|}t|t«s-|jsy|jd}t|t«sŒ-|jS)z9Return the line number which generated the invocant node.Nr)r4ÚLeafr6Úlineno©r#Únodes rÚ get_linenozBase.get_lineno|sA€àˆÜ˜T¤4Ô(Ø—=’=ØØ—=‘= Ñ#ˆDô˜T¤4Õ(ð�{‰{Ðrcó^—|jr|jj«d|_y)NT)r2r9Ú was_changedr*s rr9z Base.changed…s!€Ø �;Š;Ø �K‰K× Ñ Ô !؈Õrcóì—|jrht|jj«D]E\}}||usŒ |jj«|jj|=d|_|cSyy)z‰ Remove the node from the tree. Returns the position of the node in its parent's children before it was removed. N)r2Ú enumerater6r9)r#ÚirDs rÚremovez Base.removeŠsb€ð �;Š;Ü$ T§[¡[×%9Ñ%9Ö:‘��4ؘ4’<Ø—K‘K×'Ñ'Ô)ØŸ ™ ×,Ñ,¨QÐ/Ø"&�D”KØ’Hñ ;ð rcóÒ—|j€yt|jj«D](\}}||usŒ |jj|dzcSy#t$rYywxYw)zŸ The node immediately following the invocant in their parent's children list. If the invocant does not have a next sibling, it is None Nr)r2rIr6Ú IndexError©r#rJÚchilds rÚ next_siblingzBase.next_sibling—si€ð �;‰;Ð Øô" $§+¡+×"6Ñ"6Ö7‰HˆAˆuؘŠ}ð ØŸ;™;×/Ñ/°°!±Ñ4Ò4ñ8øô"ò Úð ús¹AÁ A&Á%A&có¾—|j€yt|jj«D].\}}||usŒ |dk(ry|jj|dz cSy)z¤ The node immediately preceding the invocant in their parent's children list. If the invocant does not have a previous sibling, it is None. Nrr)r2rIr6rNs rÚ prev_siblingzBase.prev_sibling¨sZ€ð �;‰;Ð Øô" $§+¡+×"6Ñ"6Ö7‰HˆAˆuؘŠ}ؘ’6ÙØ—{‘{×+Ñ+¨A¨a©CÑ0Ò0ñ 8rc#óbK—|jD]}|j«Ed{–—†Œy7Œ­w©N)r6Úleaves©r#rOs rrUz Base.leaves¸s&èø€Ø—]”]ˆEØ—|‘|“~× %Ñ %ñ#Ø %ús ‚#/¥-¦/cóV—|j€yd|jj«zS)Nrr)r2Údepthr*s rrXz Base.depth¼s'€Ø �;‰;Ð ØØ�4—;‘;×$Ñ$Ó&Ñ&Ð&rcó8—|j}|€y|jS)z� Return the string immediately following the invocant node. This is effectively equivalent to node.next_sibling.prefix Ú)rPÚprefix)r#Únext_sibs rÚ get_suffixzBase.get_suffixÁs"€ð ×$Ñ$ˆØ Ð ØØ�‰Ðr©ércó6—t|«jd«S)NÚascii)r3Úencoder*s rÚ__str__z Base.__str__Ìs€Ü�t“9×#Ñ# GÓ,Ð ,r)Ú__name__Ú __module__Ú __qualname__Ú__doc__r r2r6rGÚ was_checkedrr%Ú__hash__r!r+r.r0r?rEr9rKÚpropertyrPrRrUrXr]ÚsysÚ version_inforcrrrrrs¬„ñð €DØ €FØ€HØ€KØ€Kò#ò ð€Hò "ò"ò"ò"òò.ò ò ðñ óð ð ñ 1óð 1ò&ò'ò ð ×ј&Ò ó -ð!rrcóª—eZdZdZ dd„Zd„Zd„ZejdkDreZ d„Z d„Z d „Z d „Z ed „«Zej d „«Zd „Zd„Zd„Zy)ÚNodez+Concrete implementation for interior nodes.Ncóì—|dk\sJ|«‚||_t|«|_|jD]%}|j�Jt |««‚||_Œ'|�||_|r |dd|_yd|_y)zð 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)r r5r6r2Úreprr[Úfixers_applied)r#r r6Úcontextr[rrr=s rÚ__init__z Node.__init__Ós|€ð�sŠ{Ð ˜DÓ ˆ{؈Œ ܘX›ˆŒ Ø—-”-ˆBØ—9‘9Ð$Ð .¤d¨2£hÓ .Ð$؈B�Ið ð Ð Ø ˆDŒKÙ Ø"0±Ð"3ˆDÕ à"&ˆDÕ rcóz—|jj›dt|j«›d|j›d�S©z)Return a canonical string representation.Ú(ú, Ú))rrdrr r6r*s rÚ__repr__z Node.__repr__ìs,€à#Ÿ~™~×6Ó6Ü(¨¯©Õ3Ø#Ÿ}›}ð.ð .rcóT—djtt|j««S)úk Return a pretty string representation. This reproduces the input source exactly. rZ)ÚjoinÚmapr3r6r*s rÚ __unicode__zNode.__unicode__òs€ð �w‰w”sœ3 § ¡ Ó.Ó/Ð/rr^cód—|j|jf|j|jfk(S©zCompare two nodes for equality.)r r6r"s rr!zNode._eqýs'€à— ‘ ˜4Ÿ=™=Ð)¨e¯j©j¸%¿.¹.Ð-IÑIÐIrcóœ—t|j|jD�cgc]}|j«‘Œc}|j¬«Scc}w©z$Return a cloned (deep) copy of self.)rr)rnr r6r+rr)r#r=s rr+z Node.clones<€ä�D—I‘I°T·]²]ÓC±]¨r §¡¥ °]ÑCØ#'×#6Ñ#6ô8ð 8ùÒCsŸA c#ójK—|jD]}|j«Ed{–—†Œ|–—y7Œ ­w©z*Return a post-order iterator for the tree.N)r6r.rVs rr.zNode.post_orders0èø€à—]”]ˆEØ×'Ñ'Ó)× )Ñ )ð#à‹ ð *ús ‚#3¥1¦ 3c#ójK—|–—|jD]}|j«Ed{–—†Œy7Œ­w©z)Return a pre-order iterator for the tree.N)r6r0rVs rr0zNode.pre_order s,èø€àŠ Ø—]”]ˆEØ—‘Ó(× (Ñ (ñ#Ø (ús ‚'3©1ª3cóN—|jsy|jdjS)zO The whitespace and comments preceding this node in the input. rZr©r6r[r*s rr[z Node.prefixs#€ð �}Š}ØØ�}‰}˜QÑ×&Ñ&Ð&rcóF—|jr||jd_yy©Nrr‰©r#r[s rr[z Node.prefixs€à �=Š=Ø&,ˆD�M‰M˜!Ñ Õ #ð rcóx—||_d|j|_||j|<|j«y)z… Equivalent to 'node.children[i] = child'. This method also sets the child's parent attribute appropriately. N)r2r6r9rNs rÚ set_childzNode.set_child s3€ð ˆŒ Ø"&ˆ� ‰ �aÑÔØ ˆ� ‰ �aÑØ � ‰ �rcój—||_|jj||«|j«y)z‹ Equivalent to 'node.children.insert(i, child)'. This method also sets the child's parent attribute appropriately. N)r2r6Úinsertr9rNs rÚ insert_childzNode.insert_child*s(€ð ˆŒ Ø � ‰ ×јQ Ô&Ø � ‰ �rcóh—||_|jj|«|j«y)zˆ Equivalent to 'node.children.append(child)'. This method also sets the child's parent attribute appropriately. N)r2r6r8r9rVs rÚ append_childzNode.append_child3s&€ð ˆŒ Ø � ‰ ×јUÔ#Ø � ‰ �r©NNN)rdrerfrgrtrzrrkrlrcr!r+r.r0rjr[ÚsetterrŽr‘r“rrrrnrnÏs„„á5ðØØ $ó'ò2.ò 0ð ×ј&Ò ØˆòJò8ò ò )ð ñ'óð'ð ‡]�]ñ-óð-òòórrncóª—eZdZdZdZdZdZddgfd„Zd„Zd„Z e jdkDre Z d „Z d „Zd „Zd „Zd „Zed„«Zej(d„«Zy)rAz'Concrete implementation for leaf nodes.rZrNcó¬—d|cxkr dksJ|«‚J|«‚|�|\|_\|_|_||_||_|�||_|dd|_y)z— Initializer. Takes a type constant (a token number < 256), a string value, and an optional context keyword argument. rrpN)Ú_prefixrBÚcolumnr Úvaluerr)r#r ršrsr[rrs rrtz Leaf.__init__Fsf€ð�DŒ˜3ŠÐ$ Ó$‰Ð$ Ó$ˆØ Ð Ø7>Ñ 4ˆDŒLÑ4˜4œ;¨¬ ؈Œ ؈Œ Ø Ð Ø!ˆDŒLØ,©QÐ/ˆÕrcóh—|jj›d|j›d|j›d�Srv)rrdr ršr*s rrzz Leaf.__repr__Ys'€à#Ÿ~™~×6Ó6Ø#Ÿy›yØ#Ÿz›zð+ð +rcóF—|jt|j«zS)r|)r[r3ršr*s rrzLeaf.__unicode___s€ð �{‰{œS §¡›_Ñ,Ð,rr^cód—|j|jf|j|jfk(Sr�)r ršr"s rr!zLeaf._eqjs'€à— ‘ ˜4Ÿ:™:Ð&¨5¯:©:°u·{±{Ð*CÑCÐCrcó —t|j|j|j|j|j ff|j ¬«Srƒ)rAr ršr[rBr™rrr*s rr+z Leaf.clonens=€ä�D—I‘I˜tŸz™zØ—[‘[ 4§;¡;°· ± Ð"<Ð=Ø#'×#6Ñ#6ô8ð 8rc#óK—|–—y­wrTrr*s rrUz Leaf.leavests èø€Ø‹ ùó‚c#óK—|–—y­wr…rr*s rr.zLeaf.post_orderwó èø€à‹ ùr c#óK—|–—y­wr‡rr*s rr0zLeaf.pre_order{r¢r có—|jS)zP The whitespace and comments preceding this token in the input. )r˜r*s rr[z Leaf.prefixs€ð �|‰|Ðrcó2—|j«||_yrT)r9r˜rŒs rr[z Leaf.prefix†s€à � ‰ ŒØˆ� r)rdrerfrgr˜rBr™rtrzrrkrlrcr!r+rUr.r0rjr[r•rrrrArA=s‹„á1ð€GØ €FØ €FðØØ "ó0ò&+ò -ð ×ј&Ò ØˆòDò8ò òòðñóðð  ‡]�]ñóñrrAcóŽ—|\}}}}|s||jvr!t|«dk(r|dSt|||¬«St|||¬«S)zõ 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. rr)rs)Ú number2symbolÚlenrnrA)ÚgrÚraw_noder ršrsr6s rÚconvertr«‹sX€ð&.Ñ"€Dˆ%�˜(Ù�4˜2×+Ñ+Ñ+ô ˆx‹=˜AÒ Ø˜A‘;Ð Ü�D˜(¨GÔ4Ð4ä�D˜%¨Ô1Ð1rcóD—eZdZdZdZdZdZd„Zd„Zd„Z d d„Z d d„Z d„Z y) Ú BasePatterna” 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. NcóJ—|tusJd«‚tj|«S)z>Constructor that prevents BasePattern from being instantiated.zCannot instantiate BasePattern)r­rrrs rrzBasePattern.__new__³s%€àœ+Ñ%ÐGÐ'GÓGÐ%Ü�~‰~˜cÓ"Ð"rcóð—t|j«|j|jg}|r|d€ |d=|r|d€Œ |jj ›ddj tt|««›d�S)Néÿÿÿÿrwrxry) rr Úcontentrrrdr}r~rq)r#rs rrzzBasePattern.__repr__¸sd€Ü˜$Ÿ)™)Ó$ d§l¡l°D·I±IÐ>ˆÙ�t˜B‘xÐ'Ø�R�ñ�t˜B‘xÑ'àŸ>™>×2Ó2°D·I±I¼cÄ$È»oÕ4NÐOÐOrcó—|S)zŒ A subclass can define this as a hook for optimizations. Returns either self or another node with the same effect. rr*s rÚoptimizezBasePattern.optimize¾s €ð ˆ rcóú—|j�|j|jk7ry|j�,d}|�i}|j||«sy|r|j|«|�|jr|||j<y)a# 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. NFT)r r±Ú _submatchÚupdater)r#rDÚresultsÚrs rÚmatchzBasePattern.matchÆsw€ð �9‰9Ð  T§Y¡Y°$·)±)Ò%;ØØ �<‰<Ð #؈AØÐ"Ø�Ø—>‘> $¨Ô*ØÙØ—‘˜qÔ!Ø Ð  4§9¢9Ø!%ˆG�D—I‘IÑ ØrcóJ—t|«dk7ry|j|d|«S)z� Does this pattern exactly match a sequence of nodes? Default implementation for non-wildcard patterns. rFr)r¨r¹)r#Únodesr·s rÚ match_seqzBasePattern.match_seqßs'€ô ˆu‹:˜Š?ØØ�z‰z˜% ™( GÓ,Ð,rc#óNK—i}|r|j|d|«rd|f–—yyy­w)z} Generator yielding all matches for this pattern. Default implementation for non-wildcard patterns. rrN)r¹)r#r»r¸s rÚgenerate_matcheszBasePattern.generate_matchesés1èø€ð ˆÙ �T—Z‘Z  a¡¨!Ô,Ø�Q�$‹Jð-ˆ5ùs‚#%rT) rdrerfrgr r±rrrzr³r¹r¼r¾rrrr­r­žs7„ñ ð €DØ€GØ €Dò#ò Pò óó2-órr­có$—eZdZdd„Zdd„Zdd„Zy)Ú LeafPatternNcóª—|�d|cxkr dksJ|«‚J|«‚|� t|t«sJt|««‚||_||_||_y)ap 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. Nrrp)r4r3rqr r±r)r#r r±rs rrtzLeafPattern.__init__ös]€ð Рؘ”?˜s’?Ð ( DÓ (‘?Ð ( DÓ (�?Ø Ð Ü˜g¤sÔ+Ð :¬T°'«]Ó :Ð+؈Œ ؈Œ ؈� rcóR—t|t«sytj|||«S)z*Override match() to insist on a leaf node.F)r4rAr­r¹©r#rDr·s rr¹zLeafPattern.match s$€ä˜$¤Ô%ØÜ× Ñ   t¨WÓ5Ð5rcó4—|j|jk(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. )r±ršrÃs rrµzLeafPattern._submatchs€ð�|‰|˜tŸz™zÑ)Ð)rr”rT)rdrerfrtr¹rµrrrrÀrÀôs„óó(6ô *rrÀcó —eZdZdZdd„Zdd„Zy)Ú NodePatternFNcó,—|� |dk\sJ|«‚|�ot|t«rJt|««‚t|«}t |«D]6\}}t|t «s J||f«‚t|t «sŒ0d|_Œ8||_||_ ||_ y)ad 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. NrpT) r4r3rqr5rIr­ÚWildcardPatternÚ wildcardsr r±r)r#r r±rrJÚitems rrtzNodePattern.__init__$s—€ð Рؘ3’;Ð $ Ó $�;Ø Ð Ü! '¬3Ô/Ð >´°g³Ó >Ð/ܘ7“mˆGÜ$ WÖ-‘��4Ü! $¬ Ô4Ð?°q¸$°iÓ?Ð4ܘd¤OÕ4Ø%)�D•Nð.ðˆŒ ØˆŒ ؈� rcó˜—|jrVt|j|j«D]2\}}|t |j«k(sŒ|�|j |«yyt |j«t |j«k7ryt |j|j«D]\}}|j||«rŒyy)rÅTF)rÊr¾r±r6r¨r¶Úzipr¹)r#rDr·Úcr¸Ú subpatternrOs rrµzNodePattern._submatchAs¨€ð �>Š>Ü(¨¯©°t·}±}ÖE‘��1Øœ˜DŸM™MÓ*Ó*ØÐ*ØŸ™ qÔ)Ùð Fð Ü ˆt�|‰|Ó ¤ D§M¡MÓ 2Ò 2ØÜ!$ T§\¡\°4·=±=Ö!AÑ ˆJ˜Ø×#Ñ# E¨7Õ3Ùð"Bðrr”rT)rdrerfrÊrtrµrrrrÇrÇ s„à€Ióô:rrÇcóN—eZdZdZddedfd„Zd„Zd d„Zd d„Zd„Z d „Z d „Z d „Z y) rÉa 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. Nrcó,—d|cxkr|cxkr tks nJ||f«‚|�Vttt|««}t|«sJt |««‚|D]}t|«rŒJt |««‚||_||_||_||_y)aÏ 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)* rN) ÚHUGEÚtupler~r¨rqr±ÚminÚmaxr)r#r±rÔrÕrÚalts rrtzWildcardPattern.__init__ksŒ€ð.�CÔ&˜3Ô&¤$Ô&Ð2¨¨c¨ Ó2Ð&Ø Ð ÜœC¤ wÓ/Ó0ˆGä�w”<Ð .¤ g£Ó .�<Û�ܘ3•xÐ*¤ c£Ó*�xðàˆŒ ؈ŒØˆŒØˆ� rcó°—d}|j�Et|j«dk(r-t|jd«dk(r|jdd}|jdk(r\|jdk(rM|j€t |j ¬«S|�)|j |j k(r|j «S|jdkrˆt|t«rx|jdkri|j |j k(rPt|j|j|jz|j|jz|j «S|S)z+Optimize certain stacked wildcard patterns.Nrr)r) r±r¨rÔrÕrÇrr³r4rÉ)r#rÏs rr³zWildcardPattern.optimizeŽs €àˆ Ø �L‰LÐ $Ü �— ‘ Ó  Ò "¤s¨4¯<©<¸©?Ó';¸qÒ'@ØŸ™ a™¨Ñ+ˆJØ �8‰8�qŠ=˜TŸX™X¨š]Ø�|‰|Ð#Ü"¨¯ © Ô2Ð2ØÐ%¨4¯9©9¸ ¿¹Ò+GØ!×*Ñ*Ó,Ð,Ø �H‰H˜ŠMœj¨´_ÔEØ �N‰N˜aÒ  D§I¡I°·±Ò$@Ü" :×#5Ñ#5Ø#'§8¡8¨J¯N©NÑ#:Ø#'§8¡8¨J¯N©NÑ#:Ø#-§?¡?ó4ð 4ðˆ rcó(—|j|g|«S)z'Does this pattern exactly match a node?)r¼rÃs rr¹zWildcardPattern.match¡s€à�~‰~˜t˜f gÓ.Ð.rcóÄ—|j|«D]L\}}|t|«k(sŒ|�5|j|«|jrt |«||j<yy)z4Does this pattern exactly match a sequence of nodes?TF)r¾r¨r¶rr5)r#r»r·rÎr¸s rr¼zWildcardPattern.match_seq¥sY€à×)Ñ)¨%Ö0‰DˆAˆqØ”C˜“J‹ØÐ&Ø—N‘N 1Ô%Ø—y’yÜ-1°%«[˜ § ¡ Ñ*Ùð 1ðrc #ó&K—|j€bt|jdtt|«|j«z«D](}i}|j r|d|||j <||f–—Œ*y|j dk(r|j |«–—yttd«r#tj}t«t_ |j|d«D])\}}|j r|d|||j <||f–—Œ+ ttd«r t_ yy#t$r@|j|«D])\}}|j r|d|||j <||f–—Œ+YŒewxYw#ttd«r t_ wwxYw­w)a" 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. NrÚ bare_nameÚ getrefcountr)r±ÚrangerÔr¨rÕrÚ_bare_name_matchesÚhasattrrkÚstderrrÚ_recursive_matchesÚ RuntimeErrorÚ_iterative_matches)r#r»Úcountr¸Ú save_stderrs rr¾z WildcardPattern.generate_matches°sdèø€ð �<‰<Ð ä˜tŸx™x¨¬S´°U³¸T¿X¹XÓ-FÑ)FÖG�Ø�Ø—9’9Ø#(¨¨% =�A�d—i‘i‘LؘQ�h“ñ Hð �Y‰Y˜+Ò %Ø×)Ñ)¨%Ó0Ó 0ô ”s˜MÔ*Ü!Ÿj™j� Ü%›Z”” ð -Ø $× 7Ñ 7¸¸qÖ A‘H�E˜1Ø—y’yØ',¨V¨e }˜˜$Ÿ)™)™ Ø ˜(“Nñ!Bôœ3  Ô.Ø!,”C•Jð/øô ò #ð!%× 7Ñ 7¸Ö >‘H�E˜1Ø—y’yØ',¨V¨e }˜˜$Ÿ)™)™ Ø ˜(“Nò!?ð #ûôœ3  Ô.Ø!,”C•Jð/üs=‚CFÃ>D$ÄE0ÄFÄ$AE-Å*E0Å,E-Å-E0Å0FÆFc#óK—t|«}d|jk\rdif–—g}|jD]/}t||«D]\}}||f–—|j ||f«Œ Œ1|r™g}|D]Œ\}} ||ksŒ ||j ksŒ|jD]b}t|||d«D]N\} } | dkDsŒ i}|j | «|j | «|| z|f–—|j || z|f«ŒPŒdŒŽ|}|rŒ˜yy­w)z(Helper to iteratively yield the matches.rN)r¨rÔr±r¾r8rÕr¶) r#r»Únodelenr·rÖrÎr¸Ú new_resultsÚc0Úr0Úc1Úr1s rrãz"WildcardPattern._iterative_matchesÝs èø€ä�e“*ˆØ �—‘Š=Ø�R�%ŠKàˆà—<”<ˆCÜ(¨¨eÖ4‘��1ؘ�d’ Ø—‘  1˜vÕ&ñ5ð ñ ؈KÛ!‘��Bà˜“< B¨$¯(©(£NØ#Ÿ|œ|˜Ü&6°s¸EÀ"À#¸JÖ&G™F˜B Ø! A›vØ$& Ø !§¡¨¤ Ø !§¡¨¤ Ø&(¨2¡g¨q jÒ 0Ø +× 2Ñ 2°B¸±G¸Q°<Õ @ñ 'Hñ ,ð"ð"ˆGôùs‚A2C?Á5C?Â)C?Â/A C?Ã=C?cóÖ—d}i}d}t|«}|sA||krrýs¢ðñð3€ ã Ýà€à€ ò6ôn-ˆ6ôn-ô`kˆ4ôkô\Lˆ4ôLò\2ô&S�&ôSôl)*�+ô)*ôX:�+ô:ôzy)�kôy)ôx �[ô óF%r