/opt/alt/python35/lib64/python3.5/lib2to3/__pycache__
NameSizeModeActions
btm_matcher.cpython-35.opt-1.pyc53160644editdlrm
btm_matcher.cpython-35.opt-2.pyc37310644editdlrm
btm_matcher.cpython-35.pyc53160644editdlrm
btm_utils.cpython-35.opt-1.pyc67860644editdlrm
btm_utils.cpython-35.opt-2.pyc52540644editdlrm
btm_utils.cpython-35.pyc67860644editdlrm
fixer_base.cpython-35.opt-1.pyc65030644editdlrm
fixer_base.cpython-35.opt-2.pyc37280644editdlrm
fixer_base.cpython-35.pyc65030644editdlrm
fixer_util.cpython-35.opt-1.pyc133520644editdlrm
fixer_util.cpython-35.opt-2.pyc111740644editdlrm
fixer_util.cpython-35.pyc133520644editdlrm
main.cpython-35.opt-1.pyc91390644editdlrm
main.cpython-35.opt-2.pyc73720644editdlrm
main.cpython-35.pyc91780644editdlrm
patcomp.cpython-35.opt-1.pyc60350644editdlrm
patcomp.cpython-35.opt-2.pyc55150644editdlrm
patcomp.cpython-35.pyc63320644editdlrm
pygram.cpython-35.opt-1.pyc12590644editdlrm
pygram.cpython-35.opt-2.pyc10440644editdlrm
pygram.cpython-35.pyc12590644editdlrm
pytree.cpython-35.opt-1.pyc260050644editdlrm
pytree.cpython-35.opt-2.pyc165910644editdlrm
pytree.cpython-35.pyc268690644editdlrm
refactor.cpython-35.opt-1.pyc227610644editdlrm
refactor.cpython-35.opt-2.pyc187010644editdlrm
refactor.cpython-35.pyc228030644editdlrm
__init__.cpython-35.opt-1.pyc1360644editdlrm
__init__.cpython-35.opt-2.pyc1280644editdlrm
__init__.cpython-35.pyc1360644editdlrm
__main__.cpython-35.opt-1.pyc2330644editdlrm
__main__.cpython-35.opt-2.pyc2250644editdlrm
__main__.cpython-35.pyc2330644editdlrm
Edit: /opt/alt/python35/lib64/python3.5/lib2to3/__pycache__/pytree.cpython-35.pyc (26869B)
 yzfm@sdZdZddlZddlZddlmZdZiaddZGdd d e Z Gd d d e Z Gd d d e Z ddZ Gddde ZGdddeZGdddeZGdddeZGdddeZddZdS)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)StringIOicCsbtsRddlm}x9|jjD](\}}t|tkr&|t|sys version_inforBr r r rr s0            rc@seZdZdZdddddZddZddZejdkrTeZ d d Z d dZ ddZ ddZ ddZddZeeeZddZddZddZdS)Nodez+Concrete implementation for interior nodes.NcCs|dkst|||_t||_x;|jD]0}|jdksatt|||_q:W|dk r||_|r|dd|_n d|_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)rrr$r%r!reprr=fixers_applied)rrr%contextr=rNr+r r r__init__s  !   z Node.__init__cCs#d|jjt|j|jfS)z)Return a canonical string representation.z %s(%s, %r))rrCrrr%)rr r r__repr__s  z Node.__repr__cCsdjtt|jS)zk Return a pretty string representation. This reproduces the input source exactly. r<)joinmapr"r%)rr r r __unicode__szNode.__unicode__r?rcCs"|j|jf|j|jfkS)zCompare two nodes for equality.)rr%)rrr r rrszNode._eqcCs)t|jdd|jDd|jS)z$Return a cloned (deep) copy of self.cSsg|]}|jqSr )r).0r+r r r s zNode.clone..rN)rKrr%rN)rr r rrsz Node.cloneccs,x |jD]}|jEdHq W|VdS)z*Return a post-order iterator for the tree.N)r%r)rr7r r rrszNode.post_orderccs,|Vx |jD]}|jEdHqWdS)z)Return a pre-order iterator for the tree.N)r%r )rr7r r rr szNode.pre_ordercCs|js dS|jdjS)zO The whitespace and comments preceding this node in the input. r<r)r%r=)rr r r_prefix_getters zNode._prefix_gettercCs|jr||jd_dS)Nr)r%r=)rr=r r r_prefix_setters zNode._prefix_settercCs4||_d|j|_||j|<|jdS)z Equivalent to 'node.children[i] = child'. This method also sets the child's parent attribute appropriately. N)r!r%r()rr4r7r r r set_child!s  zNode.set_childcCs*||_|jj|||jdS)z Equivalent to 'node.children.insert(i, child)'. This method also sets the child's parent attribute appropriately. N)r!r%insertr()rr4r7r r r insert_child+s zNode.insert_childcCs'||_|jj||jdS)z Equivalent to 'node.children.append(child)'. This method also sets the child's parent attribute appropriately. N)r!r%r'r()rr7r r r append_child4s zNode.append_child)r?r)rCrDrErFrPrQrTrIrJrBrrrr rWrXrHr=rYr[r\r r r rrKs$          rKc@seZdZdZdZdZdZddgddZddZd d Z e j dkrfe Z d d Z ddZddZddZddZddZddZeeeZdS)r.z'Concrete implementation for leaf nodes.r<rNcCsd|kodkns(t||dk rO|\|_\|_|_||_||_|dk rv||_|dd|_dS)z Initializer. Takes a type constant (a token number < 256), a string value, and an optional context keyword argument. rrLN)r_prefixr/columnrvaluerN)rrr_rOr=rNr r rrPGs (     z Leaf.__init__cCsd|jj|j|jfS)z)Return a canonical string representation.z %s(%r, %r))rrCrr_)rr r rrQZs z Leaf.__repr__cCs|jt|jS)zk Return a pretty string representation. This reproduces the input source exactly. )r=r"r_)rr r rrT`szLeaf.__unicode__r?cCs"|j|jf|j|jfkS)zCompare two nodes for equality.)rr_)rrr r rrkszLeaf._eqcCs4t|j|j|j|j|jffd|jS)z$Return a cloned (deep) copy of self.rN)r.rr_r=r/r^rN)rr r rrosz Leaf.cloneccs |VdS)Nr )rr r rr:usz Leaf.leavesccs |VdS)z*Return a post-order iterator for the tree.Nr )rr r rrxszLeaf.post_orderccs |VdS)z)Return a pre-order iterator for the tree.Nr )rr r rr |szLeaf.pre_ordercCs|jS)zP The whitespace and comments preceding this token in the input. )r])rr r rrWszLeaf._prefix_gettercCs|j||_dS)N)r(r])rr=r r rrXs zLeaf._prefix_setter)r?r)rCrDrErFr]r/r^rPrQrTrIrJrBrrr:rr rWrXrHr=r r r rr.>s&          r.cCsk|\}}}}|s'||jkrTt|dkrA|dSt||d|St||d|SdS)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. rrrON)Z number2symbollenrKr.)ZgrZraw_noderr_rOr%r r rconverts rac@sveZdZdZdZdZdZddZddZddZ dd d Z dd d Z d dZ 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. NcOs%|tk stdtj|S)z>Constructor that prevents BasePattern from being instantiated.zCannot instantiate BasePattern)rbrrr)rrrr r rrszBasePattern.__new__cCsht|j|j|jg}x!|rA|ddkrA|d=q!Wd|jjdjtt|fS)Nrz%s(%s)z, rc) rrcontentr rrCrRrSrM)rrr r rrQs zBasePattern.__repr__cCs|S)z A subclass can define this as a hook for optimizations. Returns either self or another node with the same effect. r )rr r roptimizeszBasePattern.optimizecCs|jdk r%|j|jkr%dS|jdk rud}|dk rLi}|j||sbdS|ru|j||dk r|jr|||j= 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. NrLT) rr#r"rMr$r3rbWildcardPattern wildcardsrrdr )rrrdr r4itemr r rrP%s  " !   zNodePattern.__init__cCs|jrexUt|j|jD]>\}}|t|jkr|dk rY|j|dSqWdSt|jt|jkrdSx9t|j|jD]"\}}|j||sdSqWdS)a 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. NTF)rqrmrdr%r`rgziprj)rr0rhcri subpatternr7r r rrfBs "  "zNodePattern._submatch)rCrDrErqrPrfr r r rro!s roc@seZdZdZddedddZddZddd Zdd d Zd d Z ddZ ddZ ddZ dS)rpa 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. NrcCsd|ko"|ko"tkns9t||f|dk rttt|}t|sxtt|x,|D]$}t|stt|qW||_||_||_||_ 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) HUGErtuplerSr`rMrdminmaxr )rrdrxryr altr r rrPls9  "   zWildcardPattern.__init__cCs)d}|jdk rTt|jdkrTt|jddkrT|jdd}|jdkr|jdkr|jdkrtd|jS|dk r|j|jkr|jS|jdkr%t|tr%|jdkr%|j|jkr%t|j|j|j|j|j|jS|S)z+Optimize certain stacked wildcard patterns.Nrrr ) rdr`rxryror rer#rp)rrur r rres . !    zWildcardPattern.optimizecCs|j|g|S)z'Does this pattern exactly match a node?)rl)rr0rhr r rrjszWildcardPattern.matchcCsoxh|j|D]W\}}|t|kr|dk rc|j||jrct|||j s"   nN V,=#