/opt/alt/python-internal/lib64/python3.11/lib2to3/__pycache__
NameSizeModeActions
btm_matcher.cpython-311.opt-1.pyc78200644editdlrm
btm_matcher.cpython-311.opt-2.pyc62700644editdlrm
btm_matcher.cpython-311.pyc78200644editdlrm
btm_utils.cpython-311.opt-1.pyc115360644editdlrm
btm_utils.cpython-311.opt-2.pyc100620644editdlrm
btm_utils.cpython-311.pyc115360644editdlrm
fixer_base.cpython-311.opt-1.pyc84370644editdlrm
fixer_base.cpython-311.opt-2.pyc57580644editdlrm
fixer_base.cpython-311.pyc84370644editdlrm
fixer_util.cpython-311.opt-1.pyc223870644editdlrm
fixer_util.cpython-311.opt-2.pyc203740644editdlrm
fixer_util.cpython-311.pyc223870644editdlrm
main.cpython-311.opt-1.pyc152260644editdlrm
main.cpython-311.opt-2.pyc134900644editdlrm
main.cpython-311.pyc152720644editdlrm
patcomp.cpython-311.opt-1.pyc102290644editdlrm
patcomp.cpython-311.opt-2.pyc97500644editdlrm
patcomp.cpython-311.pyc107310644editdlrm
pygram.cpython-311.opt-1.pyc20760644editdlrm
pygram.cpython-311.opt-2.pyc18790644editdlrm
pygram.cpython-311.pyc20760644editdlrm
pytree.cpython-311.opt-1.pyc352160644editdlrm
pytree.cpython-311.opt-2.pyc268670644editdlrm
pytree.cpython-311.pyc369990644editdlrm
refactor.cpython-311.opt-1.pyc384500644editdlrm
refactor.cpython-311.opt-2.pyc345450644editdlrm
refactor.cpython-311.pyc385320644editdlrm
__init__.cpython-311.opt-1.pyc3930644editdlrm
__init__.cpython-311.opt-2.pyc3930644editdlrm
__init__.cpython-311.pyc3930644editdlrm
__main__.cpython-311.opt-1.pyc3370644editdlrm
__main__.cpython-311.opt-2.pyc3370644editdlrm
__main__.cpython-311.pyc3370644editdlrm
Edit: /opt/alt/python-internal/lib64/python3.11/lib2to3/__pycache__/pytree.cpython-311.pyc (36999B)
§ àÍÏ'ùo'ãó—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„ZdS)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óÔ—tsGddlm}|j ¦«D]'\}}t |¦«t kr |t|<Œ(t ||¦«S)Né)Úpython_symbols)Ú _type_reprsÚpygramrÚ__dict__ÚitemsÚtypeÚintÚ setdefault)Útype_numrÚnameÚvals ú;/opt/alt/python-internal/lib64/python3.11/lib2to3/pytree.pyÚ type_reprrsq€å ð9Ø*Ð*Ð*Ð*Ð*Ð*ð(Ô0×6Ò6Ñ8Ô8ð 9ð 9‰IˆD�#Ý�C‰yŒy�CÒаD¥¨SÑ!1øÝ × !Ò ! (¨HÑ 5Ô 5Ð5ócóÄ—eZdZdZdZdZdZdZdZd„Z d„Z dZ d„Z d„Z d „Zd „Zd „Zd „Zd „Zd„Zed„¦«Zed„¦«Zd„Zd„Zd„Zejdkrd„ZdSdS)Ú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ó\—|tus Jd¦«‚t |¦«S)z7Constructor that prevents Base from being instantiated.zCannot instantiate Base)rÚobjectÚ__new__©ÚclsÚargsÚkwdss rrz Base.__new__1s(€à�$ˆˆˆÐ 9‰ŒˆÝ�~Š~˜cÑ"Ô"Ð"rcóV—|j|jurtS| |¦«S)zW Compare two nodes for equality. This calls the method _eq(). )Ú __class__ÚNotImplementedÚ_eq©ÚselfÚothers rÚ__eq__z Base.__eq__6s)€ð Œ> ¤Ð 0Ð 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]N}||ur3|rJ|jj||f¦«‚|�| |¦«d}Œ9| |¦«ŒO|sJ|j||f¦«‚|j ¦«||j_|D]}|j|_Œd|_dS)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€àŒ{Ð&Ð&­¨D© ¬ Ñ&Ô&Ð&؈ˆˆÝ˜#�tÑ$Ô$ð Ø�%ˆC؈ ؈ؔ+Ô&ð &ð &ˆBØ�TˆzˆzØ ÐCÐC 4¤;Ô#7¸¸sÐ"CÑCÔC�yØ�?Ø×%Ò% cÑ*Ô*Ð*Ø��à×!Ò! "Ñ%Ô%Ð%Ð%ØÐ0Ð0�t”} d¨CÐ0Ñ0Ô0ˆuØ Œ ×ÒÑÔÐØ)ˆŒ ÔØð #ð #ˆAØ”{ˆAŒHˆH؈Œ ˆ ˆ rcó”—|}t|t¦«s+|jsdS|jd}t|t¦«¯+|jS)z9Return the line number which generated the invocant node.Nr)r4ÚLeafr6Úlineno©r#Únodes rÚ get_linenozBase.get_lineno|sR€àˆÝ˜T¥4Ñ(Ô(ð $Ø”=ð Ø�Ø”= Ô#ˆDõ˜T¥4Ñ(Ô(ð $ðŒ{ÐrcóT—|jr|j ¦«d|_dS)NT)r2r9Ú was_changedr*s rr9z Base.changed…s.€Ø Œ;ð "Ø ŒK× Ò Ñ !Ô !Ð !؈ÔÐÐrcóÀ—|jrTt|jj¦«D]<\}}||ur1|j ¦«|jj|=d|_|cSŒ;dSdS)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Šs�€ð Œ;ð Ý$ T¤[Ô%9Ñ:Ô:ð ð ‘��4ؘ4�<�<Ø”K×'Ò'Ñ)Ô)Ð)Øœ Ô,¨QÐ/Ø"&�D”KØ�H�H�Hð  ð ð ð ð rcó²—|j€dSt|jj¦«D]3\}}||ur* |jj|dzcS#t$rYdSwxYwŒ4dS)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—sŽ€ð Œ;Ð Ø�4õ" $¤+Ô"6Ñ7Ô7ð ð ‰HˆAˆuؘˆ}ˆ}ð Øœ;Ô/°°!±Ô4Ð4Ð4Ð4øÝ!ð ð ð Ø˜4˜4˜4ð øøøðð ð s­AÁ AÁAcóž—|j€dSt|jj¦«D])\}}||ur |dkrdS|jj|dz cSŒ*dS)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¨su€ð Œ;Ð Ø�4õ" $¤+Ô"6Ñ7Ô7ð 1ð 1‰HˆAˆuؘˆ}ˆ}ؘ’6�6ؘ4˜4Ø”{Ô+¨A¨a©CÔ0Ð0Ð0Ð0ðð 1ð 1rc#óRK—|jD]}| ¦«Ed{V—†ŒdS©N)r6Úleaves©r#rOs rrUz Base.leaves¸sDèè€Ø”]ð &ð &ˆEØ—|’|‘~”~Ð %Ð %Ð %Ð %Ð %Ð %Ð %Ð %ð &ð &rcóL—|j€dSd|j ¦«zS)Nrr)r2Údepthr*s rrXz Base.depth¼s(€Ø Œ;Ð Ø�1Ø�4”;×$Ò$Ñ&Ô&Ñ&Ð&rcó&—|j}|€dS|jS)z� Return the string immediately following the invocant node. This is effectively equivalent to node.next_sibling.prefix NÚ)rPÚprefix)r#Únext_sibs rÚ get_suffixzBase.get_suffixÁs€ð Ô$ˆØ Ð Ø�2ØŒÐr©ércóF—t|¦« d¦«S)NÚascii)r3Úencoder*s rÚ__str__z Base.__str__Ìs€Ý�t‘9”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ð "ð "ð "ð"ð"ð"ð"ð"ð"ð"ð"ð"ðððð.ððð ð ð ð ð ð ðð ð ñ„Xð ð ð 1ð 1ñ„Xð 1ð&ð&ð&ð'ð'ð'ð ððð Ô˜&Ò Ð ð -ð -ð -ð -ð -ð!Ð rrcó¦—eZdZdZ dd„Zd„Zd„ZejdkreZ d„Z d„Z d „Z d „Z ed „¦«Zejd „¦«Zd „Zd„Zd„ZdS)ÚNodez+Concrete implementation for interior nodes.Ncó—|dks J|¦«‚||_t|¦«|_|jD]'}|j�Jt |¦«¦«‚||_Œ(|�||_|r|dd…|_dSd|_dS)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Ð$Ð$¥d¨2¡h¤hÑ$Ô$Ð$؈BŒIˆ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__ìs6€à#œ~Ô6Ð6Ð6Ý(¨¬Ñ3Ô3Ð3Ð3Ø#œ}˜}˜}ð.ð .rcó\—d tt|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ó>—|j|jf|j|jfkS©zCompare two nodes for equality.)r r6r"s rr!zNode._eqýs€à” ˜4œ=Ð)¨e¬j¸%¼.Ð-IÒIÐIrcóX—t|jd„|jD¦«|j¬¦«S)ú$Return a cloned (deep) copy of self.có6—g|]}| ¦«‘ŒSr)r+)Ú.0r=s rú zNode.clone..s €ÐCÐCÐC¨r §¢¡ ¤ ÐCÐCÐCr©rr)rnr r6rrr*s rr+z Node.clones6€å�D”IÐCÐC°T´]ÐCÑCÔCØ#'Ô#6ð8ñ8ô8ð 8rc#óZK—|jD]}| ¦«Ed{V—†Œ|V—dS©z*Return a post-order iterator for the tree.N)r6r.rVs rr.zNode.post_ordersKèè€à”]ð *ð *ˆEØ×'Ò'Ñ)Ô)Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ð )؈ ˆ ˆ ˆ ˆ rc#óZK—|V—|jD]}| ¦«Ed{V—†ŒdS©z)Return a pre-order iterator for the tree.N)r6r0rVs rr0zNode.pre_order sOèè€àˆ ˆ ˆ Ø”]ð )ð )ˆEØ—’Ñ(Ô(Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ð (ð )ð )rcó8—|jsdS|jdjS)zO The whitespace and comments preceding this node in the input. rZr©r6r[r*s rr[z Node.prefixs#€ð Œ}ð Ø�2ØŒ}˜QÔÔ&Ð&rcó<—|jr||jd_dSdS©Nrr�©r#r[s rr[z Node.prefixs+€à Œ=ð -Ø&,ˆDŒM˜!Ô Ô #Ð #Ð #ð -ð -rcót—||_d|j|_||j|<| ¦«dS)z… Equivalent to 'node.children[i] = child'. This method also sets the child's parent attribute appropriately. N)r2r6r9rNs rÚ set_childzNode.set_child s7€ð ˆŒ Ø"&ˆŒ �aÔÔØ ˆŒ �aÑØ � Š ‰Œˆˆˆrcór—||_|j ||¦«| ¦«dS)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*s4€ð ˆŒ Ø Œ ×Ò˜Q Ñ&Ô&Ð&Ø � Š ‰Œˆˆˆrcóp—||_|j |¦«| ¦«dS)zˆ Equivalent to 'node.children.append(child)'. This method also sets the child's parent attribute appropriately. N)r2r6r8r9rVs rÚ append_childzNode.append_child3s2€ð ˆŒ Ø Œ ×Ò˜UÑ#Ô#Ð#Ø � Š ‰Œˆˆˆr©NNN)rdrerfrgrtrzrrkrlrcr!r+r.r0rjr[Úsetterr’r•r—rrrrnrnÏs€€€€€à5Ð5ðØØ $ð'ð'ð'ð'ð2.ð.ð.ð 0ð0ð0ð Ô˜&Ò Ð ØˆðJðJðJð8ð8ð8ð ððð )ð)ð)ð ð'ð'ñ„Xð'ð „]ð-ð-ñ„]ð-ðððððððððððrrncó¦—eZdZdZdZdZdZddgfd„Zd„Zd„Z e j dkre Z d „Z d „Zd „Zd „Zd „Zed„¦«Zejd„¦«ZdS)rAz'Concrete implementation for leaf nodes.rZrNcó¶—d|cxkrdks nJ|¦«‚|�|\|_\|_|_||_||_|�||_|dd…|_dS)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__Fsr€ð�DˆˆŠˆ˜3Šˆˆˆˆ ‰ŒˆØ Ð Ø7>Ñ 4ˆDŒLÑ4˜4œ;¨¬ ؈Œ ؈Œ Ø Ð Ø!ˆDŒLØ,¨Q¨Q¨QÔ/ˆÔÐÐrcó@—|jj›d|j›d|j›d�Srv)rrdr ržr*s rrzz Leaf.__repr__Ys,€à#œ~Ô6Ð6Ð6Ø#œy˜y˜yØ#œz˜z˜zð+ð +rcó:—|jt|j¦«zS)r|)r[r3ržr*s rrzLeaf.__unicode___s€ð Œ{�S ¤™_œ_Ñ,Ð,rr^có>—|j|jf|j|jfkSr�)r ržr"s rr!zLeaf._eqjs€à” ˜4œ:Ð&¨5¬:°u´{Ð*CÒCÐCrcól—t|j|j|j|j|jff|j¬¦«S)rƒr‡)rAr ržr[rBr�rrr*s rr+z Leaf.clonens:€å�D”I˜tœzØ”[ 4¤;°´ Ð"<Ð=Ø#'Ô#6ð8ñ8ô8ð 8rc#óK—|V—dSrTrr*s rrUz Leaf.leavestsèè€Øˆ ˆ ˆ ˆ ˆ rc#óK—|V—dSr‰rr*s rr.zLeaf.post_orderwóèè€àˆ ˆ ˆ ˆ ˆ rc#óK—|V—dSr‹rr*s rr0zLeaf.pre_order{r¥rcó—|jS)zP The whitespace and comments preceding this token in the input. )rœr*s rr[z Leaf.prefixs €ð Œ|Ðrcó<—| ¦«||_dSrT)r9rœr�s rr[z Leaf.prefix†s€à � Š ‰ŒˆØˆŒ ˆ ˆ r)rdrerfrgrœrBr�rtrzrrkrlrcr!r+rUr.r0rjr[r™rrrrArA=s€€€€€à1Ð1ð€GØ €FØ €FðØØ "ð0ð0ð0ð0ð&+ð+ð+ð -ð-ð-ð Ô˜&Ò Ð ØˆðDðDðDð8ð8ð8ð ðððððððððððñ„Xðð  „]ððñ„]ðððrrAcó¤—|\}}}}|s ||jvr-t|¦«dkr|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®‹sn€ð&.Ñ"€Dˆ%�˜(Øð2�4˜2Ô+Ð+Ð+õ ˆx‰=Œ=˜AÒ Ð Ø˜A”;Ð Ý�D˜(¨GÐ4Ñ4Ô4Ð4å�D˜%¨Ð1Ñ1Ô1Ð1rcóF—eZdZdZdZdZdZd„Zd„Zd„Z d d„Z d d„Z d„Z dS) Ú 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ó\—|tus Jd¦«‚t |¦«S)z>Constructor that prevents BasePattern from being instantiated.zCannot instantiate BasePattern)r°rrrs rrzBasePattern.__new__³s.€à�+Ð%Ð%Ð%Ð'GÑ%Ô%Ð%Ý�~Š~˜cÑ"Ô"Ð"rcóâ—t|j¦«|j|jg}|r|d€ |d=|r|d® |jj›dd tt|¦«¦«›d�S)Néÿÿÿÿrwrxry) rr Úcontentrrrdr}r~rq)r#rs rrzzBasePattern.__repr__¸sw€Ý˜$œ)Ñ$Ô$ d¤l°D´IÐ>ˆØð �t˜B”xÐ'Ø�R�ðð �t˜B”xÐ'àœ>Ô2Ð2Ð2°D·I²I½cÅ$ȹo¼oÑ4NÔ4NÐ4NÐ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|jkrdS|j�5d}|�i}| ||¦«sdS|r| |¦«|�|jr |||j<dS)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ÆsŠ€ð Œ9Ð  T¤Y°$´)Ò%;Ð%;Ø�5Ø Œ<Ð #؈AØÐ"Ø�Ø—>’> $¨Ñ*Ô*ð Ø�uØð "Ø—’˜qÑ!Ô!Ð!Ø Ð  4¤9Ð Ø!%ˆG�D”IÑ Øˆtrcód—t|¦«dkrdS| |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ßs0€õ ˆu‰:Œ:˜Š?ˆ?Ø�5Ø�zŠz˜% œ( GÑ,Ô,Ð,rc#ó^K—i}|r$| |d|¦«r d|fV—dSdSdS)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ésSèè€ð ˆØ ð �T—Z’Z  a¤¨!Ñ,Ô,ð Ø�Q�$ˆJˆJˆJˆJˆJð ð ð ð rrT) rdrerfrgr r´rrrzr¶r¼r¿rÁrrrr°r°žs–€€€€€ð ð ð €DØ€GØ €Dð#ð#ð#ð PðPðPð ððððððð2-ð-ð-ð-ðððððrr°có&—eZdZdd„Zdd„Zdd„ZdS)Ú LeafPatternNcó—|�d|cxkrdks nJ|¦«‚|�,t|t¦«sJt|¦«¦«‚||_||_||_dS)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__ösn€ð Рؘ�?�?’?�?˜s’?�?�?�?�? D‘?”?�?Ø Ð Ý˜g¥sÑ+Ô+Ð :Ð :­T°'©]¬]Ñ :Ô :Ð+؈Œ ؈Œ ؈Œ ˆ ˆ rcóh—t|t¦«sdSt |||¦«S)z*Override match() to insist on a leaf node.F)r4rAr°r¼©r#rDrºs rr¼zLeafPattern.match s1€å˜$¥Ñ%Ô%ð Ø�5Ý× Ò   t¨WÑ5Ô5Ð5rcó"—|j|jkS)á„ 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Ò)Ð)rr˜rT)rdrerfrtr¼r¸rrrrÃrÃôsP€€€€€ððððð(6ð6ð6ð6ð *ð *ð *ð *ð *ð *rrÃcó"—eZdZdZdd„Zdd„ZdS)Ú NodePatternFNcór—|�|dks J|¦«‚|��t|t¦«rJt|¦«¦«‚t|¦«}t |¦«D]B\}}t|t ¦«s J||f¦«‚t|t ¦«rd|_ŒC||_||_ ||_ dS)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”mˆGÝ$ WÑ-Ô-ð *ð *‘��4Ý! $­ Ñ4Ô4Ð?Ð?°q¸$°iÑ?Ô?Ð4ݘd¥OÑ4Ô4ð*Ø%)�D”NøØˆŒ ؈Œ ؈Œ ˆ ˆ rcó†—|jrTt|j|j¦«D]7\}}|t |j¦«kr|�| |¦«dSŒ8dSt |j¦«t |j¦«krdSt |j|j¦«D]\}}| ||¦«sdSŒdS)rÈNTF)rÍrÁr´r6r«r¹Úzipr¼)r#rDrºÚcr»Ú subpatternrOs rr¸zNodePattern._submatchAsÞ€ð Œ>ð Ý(¨¬°t´}ÑEÔEð ð ‘��1Ø�˜DœMÑ*Ô*Ò*Ð*ØÐ*ØŸš qÑ)Ô)Ð)ؘ4˜4ð+ð�5Ý ˆtŒ|Ñ Ô ¥ D¤MÑ 2Ô 2Ò 2Ð 2Ø�5Ý!$ T¤\°4´=Ñ!AÔ!Að ð Ñ ˆJ˜Ø×#Ò# E¨7Ñ3Ô3ð Ø�u�uð àˆtrr˜rT)rdrerfrÍrtr¸rrrrÊrÊ sA€€€€€à€Iððððð:ðððððrrÊcóP—eZdZdZddedfd„Zd„Zd d„Zd d„Zd„Z d „Z d „Z d „Z dS) 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óv—d|cxkr|cxkr tksnJ||f¦«‚|�sttt|¦«¦«}t|¦«sJt |¦«¦«‚|D](}t|¦«sJt |¦«¦«‚Œ)||_||_||_||_dS)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Ð&Ð&Ò&Ð&¥$Ò&Ð&Ð&Ð&Ð&¨¨c¨ Ñ&Ô&Ð&Ø Ð Ý�C¥ wÑ/Ô/Ñ0Ô0ˆGå�w‘<”<Ð .Ð .¥ g¡¤Ñ .Ô .�<Øð +ð +�ݘ3‘x”xÐ*Ð*¥ c¡¤Ñ*Ô*�xÐ*؈Œ ؈ŒØˆŒØˆŒ ˆ ˆ rcó<—d}|j�It|j¦«dkr1t|jd¦«dkr|jdd}|jdkrM|jdkrB|j€t |j¬¦«S|�$|j|jkr| ¦«S|jdkrft|t¦«rQ|jdkrF|j|jkr6t|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Ð $Ý �” Ñ Ô  Ò "Ð "¥s¨4¬<¸¬?Ñ';Ô';¸qÒ'@Ð'@Øœ aœ¨Ô+ˆJØ Œ8�qŠ=ˆ=˜TœX¨š]˜]ØŒ|Ð#Ý"¨¬ Ð2Ñ2Ô2Ð2ØÐ%¨4¬9¸ ¼Ò+GÐ+GØ!×*Ò*Ñ,Ô,Ð,Ø ŒH˜ŠMˆM�j¨µ_ÑEÔEˆMØ ŒN˜aÒ Ð  D¤I°´Ò$@Ð$@Ý" :Ô#5Ø#'¤8¨J¬NÑ#:Ø#'¤8¨J¬NÑ#:Ø#-¤?ñ4ô4ð 4ðˆ rcó0—| |g|¦«S)z'Does this pattern exactly match a node?)r¿rÆs rr¼zWildcardPattern.match¡s€à�~Š~˜t˜f gÑ.Ô.Ð.rcóÒ—| |¦«D]P\}}|t|¦«kr8|�3| |¦«|jrt |¦«||j<dSŒQdS)z4Does this pattern exactly match a sequence of nodes?NTF)rÁr«r¹rr5)r#r¾rºrÑr»s rr¿zWildcardPattern.match_seq¥sy€à×)Ò)¨%Ñ0Ô0ð ð ‰DˆAˆqØ•C˜‘J”JŠˆØÐ&Ø—N’N 1Ñ%Ô%Ð%Ø”yð9Ý-1°%©[¬[˜ ¤ Ñ*Ø�t�tð ð ˆurc #ó.K—|j€^t|jdtt|¦«|j¦«z¦«D]#}i}|jr|d|…||j<||fV—Œ$dS|jdkr| |¦«V—dSttd¦«r$tj }t¦«t_ |  |d¦«D]$\}}|jr|d|…||j<||fV—Œ%nJ#t$r=|  |¦«D]$\}}|jr|d|…||j<||fV—Œ%YnwxYwttd¦«r|t_ dSdS#ttd¦«r |t_ wxYw)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°sïèè€ð Œ<Ð å˜tœx¨­Sµ°U±´¸T¼XÑ-FÔ-FÑ)FÑGÔGð ð �Ø�Ø”9ð1Ø#(¨¨%¨¤=�A�d”i‘LؘQ�h����ð  ð ð ŒY˜+Ò %Ð %Ø×)Ò)¨%Ñ0Ô0Ð 0Ð 0Ð 0Ð 0Ð 0õ •s˜MÑ*Ô*ð (Ý!œj� Ý%™ZœZ•” ð -Ø $× 7Ò 7¸¸qÑ AÔ Að#ð#‘H�E˜1Ø”yð5Ø',¨V¨e¨V¤}˜˜$œ)™ Ø ˜(�N�N�N�Nð#øõ ð #ð #ð #ð!%× 7Ò 7¸Ñ >Ô >ð#ð#‘H�E˜1Ø”yð5Ø',¨V¨e¨V¤}˜˜$œ)™ Ø ˜(�N�N�N�Nð#ð#ð #øøøõ�3  Ñ.Ô.ð-Ø!,•C”J�J�Jð-ð-ø•7�3  Ñ.Ô.ð-Ø!,•C”JÐ,Ð,Ð,Ð,s+Ã;DÄE1ÄAE ÅE1ÅE Å E1Å1#Fc#óK—t|¦«}d|jkrdifV—g}|jD]5}t||¦«D]"\}}||fV—| ||f¦«Œ#Œ6|ržg}|D]“\}} ||krˆ||jkr}|jD]u}t|||d…¦«D]Z\} } | dkrOi}| | ¦«| | ¦«|| z|fV—| || z|f¦«Œ[ŒvŒ”|}|°œdSdS)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ˆKˆKàˆà”<ð 'ð 'ˆCÝ(¨¨eÑ4Ô4ð 'ð '‘��1ؘ�d� � � Ø—’  1˜vÑ&Ô&Ð&Ð&ð 'ð ð "؈KØ!ð Að A‘��Bà˜’<�< B¨$¬(¢N NØ#œ|ðAðA˜Ý&6°s¸EÀ"À#À#¼JÑ&GÔ&GðAðA™F˜B Ø! Ašv˜vØ$& Ø !§¢¨¡ ¤   Ø !§¢¨¡ ¤   Ø&(¨2¡g¨q jÐ 0Ð 0Ð 0Ø +× 2Ò 2°B¸±G¸Q°<Ñ @Ô @Ð @øð Aøð"ˆGðð "ð "ð "ð "ð "rcóæ—d}i}d}t|¦«}|sE||kr?d}|jD]-}|d |||¦«r |dz }d}nŒ.|s||k°?|d|…||j<||fS)z(Special optimized matcher for bare_name.rFTrN)r«r´r¼r)r#r¾rçr»ÚdonerØÚleafs rráz"WildcardPattern._bare_name_matchesús¨€àˆØ ˆØˆÝ�%‰jŒjˆØð ˜5 3š;˜;؈DØœ ð ð �ؘ”7—=’=  u¤¨qÑ1Ô1ðؘQ‘J�EØ �DØ�Eððð ˜5 3š;˜;ð˜V˜e˜V”}ˆˆ$Œ)‰ Ø�aˆxˆrc#óPK—|j€J‚||jkrdifV—||jkr||jD]v}t||¦«D]a\}}| ||d…|dz¦«D]:\}}i}| |¦«| |¦«||z|fV—Œ;ŒbŒudSdS)z(Helper to recursively yield the matches.Nrr)r´r×rØrÁrär¹) r#r¾rçrÙrìrírîrïr»s rräz"WildcardPattern._recursive_matches sîèè€àŒ|Ð'Ð'Ð'Ø �D”HÒ Ð Ø�R�%ˆKˆKˆKØ �4”8Ò Ð Ø”|ð )ð )�Ý.¨s°EÑ:Ô:ð)ð)‘F�B˜Ø"&×"9Ò"9¸%ÀÀÀ¼*ÀeÈAÁgÑ"NÔ"Nð)ð)™˜˜BØ˜ØŸš ™ œ ˜ ØŸš ™ œ ˜ Ø  2™g q˜jÐ(Ð(Ð(Ð(ð )ð)ð Ð ð )ð )rrT) rdrerfrgrÕrtr¶r¼r¿rÁrærárärrrrÌrÌ]s²€€€€€ð ð ð $¨°¸4ð!ð!ð!ð!ðFððð&/ð/ð/ð/ð ð ð ð ð+-ð+-ð+-ðZ"ð"ð"ð:ððð )ð )ð )ð )ð )rrÌcó(—eZdZdd„Zd„Zd„Zd„ZdS)ÚNegatedPatternNcóp—|�,t|t¦«sJt|¦«¦«‚||_dS)a 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)r4r°rqr´)r#r´s rrtzNegatedPattern.__init__s9€ð Рݘg¥{Ñ3Ô3Ð BÐ BµT¸'±]´]Ñ BÔ BÐ3؈Œ ˆ ˆ rcó—dS)NFrrCs rr¼zNegatedPattern.match(s€àˆurcó(—t|¦«dkSr�)r«)r#r¾s rr¿zNegatedPattern.match_seq,s€å�5‰zŒz˜QŠÐrc#ó¢K—|j€t|¦«dkrdifV—dSdS|j |¦«D]\}}dSdifV—dSr�)r´r«rÁ)r#r¾rÑr»s rrÁzNegatedPattern.generate_matches0srèè€Ø Œ<Ð å�5‰zŒz˜QŠˆØ˜�e� � � � � ðˆðœ ×5Ò5°eÑ<Ô<ð ð ‘��1Ø��Ø�R�%ˆKˆKˆKˆKˆKrrT)rdrerfrtr¼r¿rÁrrrrõrõsU€€€€€ð ð ð ð ððððððð ð ð ð ð rrõc#ó0K—|sdifV—dS|d|dd…}}| |¦«D]a\}}|s||fV—Œt|||d…¦«D]:\}}i}| |¦«| |¦«||z|fV—Œ;ŒbdS)aR 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. rrN)rÁr¹) Úpatternsr¾ÚpÚrestrìrírîrïr»s rrÁrÁ<sÜèè€ð ð %Ø�ˆeˆ ˆ ˆ ˆ ˆ à˜1”+˜x¨¨¨œ|ˆ4ˆØ×(Ò(¨Ñ/Ô/ð %ð %‰FˆB�Øð %ؘ"�f� � � � å.¨t°U¸2¸3¸3´ZÑ@Ô@ð%ð%‘F�B˜Ø�AØ—H’H˜R‘L”L�LØ—H’H˜R‘L”L�Lؘr™' 1˜*Ð$Ð$Ð$Ð$ð %ð  %ð %r)rgÚ __author__rkÚiorrÕrrrrrnrAr®r°rÃrÊrÌrõrÁrrrúrsòðððð3€ à € € € ØÐÐÐÐÐà€à€ ð6ð6ð6ðn-ðn-ðn-ðn-ðn-ˆ6ñn-ôn-ðn-ð`kðkðkðkðkˆ4ñkôkðkð\LðLðLðLðLˆ4ñLôLðLð\2ð2ð2ð&SðSðSðSðS�&ñSôSðSðl)*ð)*ð)*ð)*ð)*�+ñ)*ô)*ð)*ðX:ð:ð:ð:ð:�+ñ:ô:ð:ðzy)ðy)ðy)ðy)ðy)�kñy)ôy)ðy)ðx ð ð ð ð �[ñ ô ð ðF%ð%ð%ð%ð%r