/usr/lib64/python3.9/lib2to3/__pycache__
NameSizeModeActions
btm_matcher.cpython-39.opt-1.pyc48770644editdlrm
btm_matcher.cpython-39.opt-2.pyc33060644editdlrm
btm_matcher.cpython-39.pyc48770644editdlrm
btm_utils.cpython-39.opt-1.pyc61480644editdlrm
btm_utils.cpython-39.opt-2.pyc46360644editdlrm
btm_utils.cpython-39.pyc61480644editdlrm
fixer_base.cpython-39.opt-1.pyc62550644editdlrm
fixer_base.cpython-39.opt-2.pyc35040644editdlrm
fixer_base.cpython-39.pyc62550644editdlrm
fixer_util.cpython-39.opt-1.pyc121700644editdlrm
fixer_util.cpython-39.opt-2.pyc100070644editdlrm
fixer_util.cpython-39.pyc121700644editdlrm
main.cpython-39.opt-1.pyc86710644editdlrm
main.cpython-39.opt-2.pyc69180644editdlrm
main.cpython-39.pyc86890644editdlrm
patcomp.cpython-39.opt-1.pyc53890644editdlrm
patcomp.cpython-39.opt-2.pyc48810644editdlrm
patcomp.cpython-39.pyc56050644editdlrm
pygram.cpython-39.opt-1.pyc12620644editdlrm
pygram.cpython-39.opt-2.pyc10570644editdlrm
pygram.cpython-39.pyc12620644editdlrm
pytree.cpython-39.opt-1.pyc236720644editdlrm
pytree.cpython-39.opt-2.pyc149690644editdlrm
pytree.cpython-39.pyc242950644editdlrm
refactor.cpython-39.opt-1.pyc206130644editdlrm
refactor.cpython-39.opt-2.pyc165670644editdlrm
refactor.cpython-39.pyc206430644editdlrm
__init__.cpython-39.opt-1.pyc3020644editdlrm
__init__.cpython-39.opt-2.pyc3020644editdlrm
__init__.cpython-39.pyc3020644editdlrm
__main__.cpython-39.opt-1.pyc2150644editdlrm
__main__.cpython-39.opt-2.pyc2150644editdlrm
__main__.cpython-39.pyc2150644editdlrm
Edit: /usr/lib64/python3.9/lib2to3/__pycache__/patcomp.cpython-39.opt-1.pyc (5389B)
a i@sdZdZddlZddlmZmZmZmZmZm Z ddl m Z ddl m Z Gdd d e Zd d ZGd d d eZejejejddZddZddZddZdS)zPattern compiler. The grammar is taken from PatternGrammar.txt. The compiler compiles a pattern to a pytree.*Pattern instance. z#Guido van Rossum N)driverliteralstokentokenizeparsegrammar)pytree)pygramc@s eZdZdS)PatternSyntaxErrorN)__name__ __module__ __qualname__rr'/usr/lib64/python3.9/lib2to3/patcomp.pyr sr c csLtjtjtjh}tt|j}|D] }|\}}}}}||vr&|Vq&dS)z6Tokenizes a string suppressing significant whitespace.N) rNEWLINEINDENTDEDENTrgenerate_tokensioStringIOreadline) inputskiptokensZ quintupletypevaluestartendZ line_textrrrtokenize_wrappers rc@s:eZdZd ddZdddZddZdd d Zd d ZdS)PatternCompilerNcCsZ|durtj|_tj|_nt||_t|j|_tj|_ tj |_ tj |jt d|_dS)z^Initializer. Takes an optional alternative filename for the pattern grammar. N)convert)r Zpattern_grammarrZpattern_symbolssymsrZ load_grammarZSymbolsZpython_grammarZ pygrammarZpython_symbolspysymsZDriverpattern_convert)selfZ grammar_filerrr__init__(s  zPatternCompiler.__init__Fc Csrt|}z|jj||d}Wn4tjyP}ztt|dWYd}~n d}~00|rd|||fS||SdS)z=Compiles a pattern string to a nested pytree.*Pattern object.)debugN)rrZ parse_tokensrZ ParseErrorr str compile_node)r%rr'Z with_treerrooterrrcompile_pattern7s$zPatternCompiler.compile_patternc sV|jjjkr|jd}|jjjkrzfdd|jdddD}t|dkrX|dStjdd|Dddd}|S|jjj krʇfd d|jD}t|dkr|dStj|gddd}|S|jjj kr |jdd}t |}|Sd}|j}t|d kr>|djt jkr>|dj}|dd}d}t|dkrx|d jjjkrx|d }|dd } ||}|dur>|j} | d} | jt jkrd} tj} nX| jt jkrd} tj} n>| jt jkr| d} } t| d kr| d } n| dks"| dkr>|}tj|gg| | d}|durN||_|S) zXCompiles a node, recursively. This is one big switch on the node type. rcsg|]}|qSrr).0Zchr%rr Oz0PatternCompiler.compile_node..NrcSsg|] }|gqSrr)r/arrrr1Rr2minmaxcsg|]}|qSrr-r.r0rrr1Vr2)rr"ZMatcherchildrenZ Alternativeslenr WildcardPatternoptimizeZ AlternativeZ NegatedUnit compile_basicZNegatedPatternrEQUALrZRepeaterSTARZHUGEPLUSLBRACEget_intname) r%nodeZaltspZunitspatternrEnodesrepeatr;childr6r7rr0rr)Cs^       "    zPatternCompiler.compile_nodecCs@|d}|jtjkr4tt|j}tt ||S|jtj kr|j}| r|t vrbt d||ddrvt dtt |S|dkrd}n,|dst|j|d}|durt d||ddr||djdg}nd}t||SnH|jdkr||dS|jd kr<||d}tj|ggddd SdS) NrzInvalid token: %rrzCan't have details for tokenany_zInvalid symbol: %r([r5)rrSTRINGr(rZ evalStringrr Z LeafPattern_type_of_literalNAMEisupper TOKEN_MAPr startswithgetattrr#r)r;Z NodePatternr=)r%rIrJrFrrZcontent subpatternrrrr?s8         zPatternCompiler.compile_basiccCs t|jSN)intr)r%rFrrrrDszPatternCompiler.get_int)N)FF)N)r r rr&r,r)r?rDrrrrr &s   G #r )rRrPNUMBERZTOKENcCs.|drtjS|tjvr&tj|SdSdS)Nr)isalpharrRrZopmap)rrrrrQs    rQcCs>|\}}}}|s||jvr*tj|||dStj|||dSdS)z9Converts raw node information to a Node or Leaf instance.)contextN)Z number2symbolr ZNodeZLeaf)rZ raw_node_inforrr\r;rrrr$s r$cCs t|SrX)r r,)rHrrrr,sr,)__doc__ __author__rZpgen2rrrrrrr r Exceptionr robjectr rRrPrZrTrQr$r,rrrrs"