python (3.11.7)

(root)/
lib/
python3.11/
lib2to3/
__pycache__/
fixer_base.cpython-311.opt-1.pyc

e"ndZddlZddlmZddlmZddlmZGddeZ	Gd	d
e	Z
dS)z2Base class for fixers (optional, but recommended).N)PatternCompiler)pygram)does_tree_importceZdZdZdZdZdZdZdZe	j
dZeZ
dZdZdZdZdZdZejZdZdZd	Zd
ZdZdd
ZdZddZdZdZ dZ!dS)BaseFixaOptional base class for fixers.

    The subclass name must be FixFooBar where FooBar is the result of
    removing underscores and capitalizing the words of the fix name.
    For example, the class name for a fixer named 'has_key' should be
    FixHasKey.
    NrpostFcJ||_||_|dS)aInitializer.  Subclass may override.

        Args:
            options: a dict containing the options passed to RefactoringTool
            that could be used to customize the fixer through the command line.
            log: a list to append warnings and other messages to.
        N)optionslogcompile_pattern)selfrr
s   F/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/lib2to3/fixer_base.py__init__zBaseFix.__init__/s*c|j9t}||jd\|_|_dSdS)zCompiles self.PATTERN into self.pattern.

        Subclass may override if it doesn't want to use
        self.{pattern,PATTERN} in .match().
        NT)	with_tree)PATTERNrrpatternpattern_tree)rPCs  rrzBaseFix.compile_pattern;sS<# ""B.0.@.@KO/A/Q/Q+DL$+++$#rc||_dS)zOSet the filename.

        The main refactoring tool should call this.
        N)filename)rrs  rset_filenamezBaseFix.set_filenameFs
!


rcDd|i}|j||o|S)aReturns match for a given parse tree node.

        Should return a true or false object (not necessarily a bool).
        It may return a non-empty dict of matching sub-nodes as
        returned by a matching pattern.

        Subclass may override.
        node)rmatchrrresultss   rrz
BaseFix.matchMs*4.|!!$00<W<rct)aReturns the transformation for a given parse tree node.

        Args:
          node: the root of the parse tree that matched the fixer.
          results: a dict mapping symbolic names to part of the match.

        Returns:
          None, or a node that is a modified copy of the
          argument node.  The node argument may also be modified in-place to
          effect the same change.

        Subclass *must* override.
        )NotImplementedErrorrs   r	transformzBaseFix.transformYs"###rxxx_todo_changemec|}||jvr-|tt|jz}||jv-|j||S)zReturn a string suitable for use as an identifier

        The new name is guaranteed not to conflict with other identifiers.
        )
used_namesstrnextnumbersadd)rtemplatenames   rnew_namezBaseFix.new_nameis\
do%%c$t|"4"4555Ddo%%D!!!rc|jr)d|_|jd|jz|j|dS)NFz### In file %s ###)	first_logr
appendr)rmessages  rlog_messagezBaseFix.log_messagetsJ>	B"DNHOO04=@AAA     rc|}|}d|_d}||||fz|r||dSdS)aWarn the user that a given chunk of code is not valid Python 3,
        but that it cannot be converted automatically.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        zLine %d: could not convert: %sN)
get_linenocloneprefixr2)rrreasonlineno
for_outputmsgs      rcannot_convertzBaseFix.cannot_convertzsw""ZZ\\

.
33444	%V$$$$$	%	%rcb|}|d||fzdS)zUsed for warning the user about possible uncertainty in the
        translation.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        zLine %d: %sN)r5r2)rrr8r9s    rwarningzBaseFix.warnings7""&&)99:::::rc|j|_||tjd|_d|_dS)zSome fixers need to maintain tree-wide state.
        This method is called once, at the start of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        rTN)r&r	itertoolscountr)r/rtreers   r
start_treezBaseFix.start_trees=/(### q))rcdS)zSome fixers need to maintain tree-wide state.
        This method is called once, at the conclusion of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        NrBs   rfinish_treezBaseFix.finish_trees		
r)r$N)"__name__
__module____qualname____doc__rrrrrr@rAr)setr&orderexplicit	run_order_accept_typekeep_line_order
BM_compatiblerpython_symbolssymsrrrrr#r-r2r<r>rDrGrFrrrrs1GGLGHioa  GJEHILOM
 D


	Q	Q	Q!!!
=
=
=$$$ 				!!!
%
%
%
%;;;







rrc,eZdZdZdZfdZdZxZS)ConditionalFixz@ Base class for fixers which not execute if an import is found. NcPtt|j|d|_dSrH)superrWrD_should_skip)rargs	__class__s  rrDzConditionalFix.start_trees+.nd##.55 rc|j|jS|jd}|d}d|dd}t	||||_|jS)N.)rZskip_onsplitjoinr)rrpkgr,s    rshould_skipzConditionalFix.should_skipsh($$l  %%2whhs3B3x  ,S$==  r)rIrJrKrLr`rDrd
__classcell__)r\s@rrWrWsTJJG!!!!!!!!!!!!rrW)rLr@patcomprr4r
fixer_utilrobjectrrWrFrr<module>ris98%$$$$$((((((X
X
X
X
X
fX
X
X
v!!!!!W!!!!!r