/opt/alt/python311/lib64/python3.11/lib2to3/__pycache__
Edit: /opt/alt/python311/lib64/python3.11/lib2to3/__pycache__/btm_utils.cpython-311.opt-1.pyc (11530B)
§
¬p@¤÷sã óŒ — d Z ddlmZ ddlmZmZ ddlmZmZ eZ eZ
ej ZeZ
dZdZdZ G d„ d e¦ « Zdd„Zd„ Zd
„ Zd
S )z0Utility functions used by the btm_matcher moduleé )Úpytree)ÚgrammarÚtoken)Úpattern_symbolsÚpython_symbolséÿÿÿÿéþÿÿÿéýÿÿÿc ó2 — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ ZdS ) ÚMinNodez‰This class serves as an intermediate representation of the
pattern tree during the conversion to sets of leaf-to-root
subpatternsNc óh — || _ || _ g | _ d| _ d | _ g | _ g | _ d S )NF)ÚtypeÚnameÚchildrenÚleafÚparentÚalternativesÚgroup)Úselfr r s ú8/opt/alt/python311/lib64/python3.11/lib2to3/btm_utils.pyÚ__init__zMinNode.__init__ s8 € ؈Œ ؈Œ ؈Œ
؈Œ ؈ŒØˆÔ؈Œ
ˆ
ˆ
ó c óZ — t | j ¦ « dz t | j ¦ « z S )Nú )Ústrr r )r s r Ú__repr__zMinNode.__repr__ s" € Ý�4”9‰~Œ~ Ñ#¥c¨$¬)¡n¤nÑ4Ð4r c óÐ — | }g }|�r^|j t k rr|j |¦ « t |j ¦ « t |j ¦ « k r$t
|j ¦ « g}g |_ |j }Œ{|j }d}nÜ|j t k rq|j |¦ « t |j ¦ « t |j ¦ « k r#t |j ¦ « }g |_ |j }Œü|j }d}n[|j t j k r"|j
r| |j
¦ « n| |j ¦ « |j }|�°^|S )z°Internal method. Returns a characteristic path of the
pattern tree. This method must be run for all leaves until the
linear subpatterns are merged into a singleN)r ÚTYPE_ALTERNATIVESr ÚappendÚlenr Útupler Ú
TYPE_GROUPr Úget_characteristic_subpatternÚtoken_labelsÚNAMEr )r ÚnodeÚsubps r Úleaf_to_rootzMinNode.leaf_to_root! sZ € ð ˆØˆØñ ! ØŒyÕ-Ò-Ð-ØÔ!×(Ò(¨Ñ.Ô.Ð.Ý�tÔ(Ñ)Ô)S°´Ñ-?Ô-?Ò?Ð?å! $Ô"3Ñ4Ô4Ð5�DØ(*�DÔ%Øœ;�DØàœ;�DØ�DØàŒy�JÒ&Ð&Ø”
×!Ò! $Ñ'Ô'Ð'å�t”z‘?”?¥c¨$¬-Ñ&8Ô&8Ò8Ð8Ý8¸¼ÑDÔD�DØ!#�D”JØœ;�DØàœ;�DØ�DØàŒy�LÔ-Ò-Ð-°$´)Ð-à—’˜DœIÑ&Ô&Ð&Ð&à—’˜DœIÑ&Ô&Ð&à”;ˆDðC ñ ! ðD ˆr c óh — | ¦ « D ]}| ¦ « }|r|c S ŒdS )a‹ Drives the leaf_to_root method. The reason that
leaf_to_root must be run multiple times is because we need to
reject 'group' matches; for example the alternative form
(a | b c) creates a group [b c] that needs to be matched. Since
matching multiple linear patterns overcomes the automaton's
capabilities, leaf_to_root merges each group into a single
choice based on 'characteristic'ity,
i.e. (a|b c) -> (a|b) if b more characteristic than c
Returns: The most 'characteristic'(as defined by
get_characteristic_subpattern) path for the compiled pattern
tree.
N)Úleavesr( )r Úlr' s r Úget_linear_subpatternzMinNode.get_linear_subpatternK sJ € ð —’‘”ð ð ˆAØ—>’>Ñ#Ô#ˆDØð
Ø���ð
ð ð r c # ól K — | j D ]}| ¦ « E d{V —† Œ| j s| V — dS dS )z-Generator that returns the leaves of the treeN)r r* )r Úchilds r r* zMinNode.leaves` s[ è è € à”]ð &ð