python (3.12.0)

(root)/
lib/
python3.12/
__pycache__/
symtable.cpython-312.opt-1.pyc

ˑe*ndZddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlZgdZdZGddZeZGdd	ZGd
deZGdd
eZGddZedk(rddlZddlZeej<d5ZejAZ!dddee!ejDjGej<dddZ$e$jKD]9Z&e$jOe&Z(e)e(e(jUe(jW;yy#1swYxYw)z2Interface to the compiler's internal symbol tablesN)USE
DEF_GLOBALDEF_NONLOCAL	DEF_LOCAL	DEF_PARAM
DEF_IMPORT	DEF_BOUND	DEF_ANNOT	SCOPE_OFF
SCOPE_MASKFREELOCALGLOBAL_IMPLICITGLOBAL_EXPLICITCELL)symtableSymbolTableClassFunctionSymbolcHtj|||}t||S)z Return the toplevel *SymbolTable* for the source code.

    *filename* is the name of the file with the code
    and *compile_type* is the *compile()* mode argument.
    )	_symtabler_newSymbolTable)codefilenamecompile_typetops    </BuggyBox/python/3.12.0/bootstrap/lib/python3.12/symtable.pyrrs%

T8\
:C3))ceZdZdZdZdZy)SymbolTableFactoryc6tj|_yN)weakrefWeakValueDictionary_SymbolTableFactory__memoselfs r__init__zSymbolTableFactory.__init__s113rc|jtjk(rt||S|jtjk(rt||St
||Sr#)typer
TYPE_FUNCTIONr
TYPE_CLASSrr)r(tablers   rnewzSymbolTableFactory.newsM::000E8,,::---))5(++rc||f}|jj|d}|!|j||x}|j|<|Sr#)r&getr/)r(r.rkeyobjs     r__call__zSymbolTableFactory.__call__ sGXokkooc4(;%)XXeX%>>C$++c"
rN)__name__
__module____qualname__r)r/r4rrr!r!s4,rr!c`eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZy)rc.||_||_i|_yr#)_table	_filename_symbols)r(	raw_tablers   rr)zSymbolTable.__init__,s!
rc,|jtk(rd}nd|jjz}|jjdk(rdj||jSdj||jj|jS)Nz%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>)	__class__rr5r;nameformatr<)r(kinds  r__repr__zSymbolTable.__repr__1s{>>[(D4>>222D;;u$4;;D$..QQ4;;D<@KK<L<L<@NNL
Lrc4|jjtjk(ry|jjtjk(ry|jjtj
k(ry|jjtjk(ry|jjtjk(ry|jjtjk(ry|jjtjk(ryy)	zReturn the type of the symbol table.

        The values returned are 'class', 'module', 'function',
        'annotation', 'TypeVar bound', 'type alias', and 'type parameter'.
        modulefunctionclass
annotationz
TypeVar boundz
type aliasztype parameterN)
r;r+rTYPE_MODULEr,r-TYPE_ANNOTATIONTYPE_TYPE_VAR_BOUNDTYPE_TYPE_ALIASTYPE_TYPE_PARAMr's rget_typezSymbolTable.get_type>s;;y444;;y666;;y333;;y888;;y<<<";;y888;;y888#9rc.|jjS)z,Return an identifier for the table.
        )r;idr's rget_idzSymbolTable.get_idTs{{~~rc.|jjS)zReturn the table's name.

        This corresponds to the name of the class, function
        or 'top' if the table is for a class, function or
        global respectively.
        )r;rBr's rget_namezSymbolTable.get_nameYs{{rc.|jjS)zPReturn the number of the first line in the
        block for the table.
        )r;linenor's r
get_linenozSymbolTable.get_linenobs{{!!!rcbt|jjtjk(S)zJReturn *True* if the locals in the table
        are optimizable.
        )boolr;r+rr,r's ris_optimizedzSymbolTable.is_optimizedhs$DKK$$	(?(??@@rc@t|jjS)zAReturn *True* if the block is a nested class
        or function.)rZr;nestedr's r	is_nestedzSymbolTable.is_nestednsDKK&&''rc@t|jjS)z:Return *True* if the block has nested namespaces.
        )rZr;childrenr's rhas_childrenzSymbolTable.has_childrenssDKK(())rcJ|jjjS)zKReturn a view object containing the names of symbols in the table.
        )r;symbolskeysr's rget_identifierszSymbolTable.get_identifiersxs{{""''))rc|jj|}|a|jj|}|j	|}|jj
dk(}t
||||x}|j|<|S)zLLookup a *name* in the table.

        Returns a *Symbol* instance.
        rmodule_scope)r=r1r;rc_SymbolTable__check_childrenrBr)r(rBsymflags
namespacesrhs      rlookupzSymbolTable.lookup}s
mm%;KK''-E..t4J KK,,5L(.tUJ<H)J
JC$--%
rcf|jDcgc]}|j|c}Scc}w)zLReturn a list of *Symbol* instances for
        names in the table.
        )rerm)r(idents  rget_symbolszSymbolTable.get_symbolss*150D0D0FGuE"GGGs.c|jjDcgc]'}|j|k(rt||j)c}Scc}wr#)r;r`rBrr<)r(rBsts   r__check_childrenzSymbolTable.__check_childrensB++..$77d? DNN3$	$$s,Ac||jjDcgc]}t||jc}Scc}w)z3Return a list of the nested symbol tables.
        )r;r`rr<)r(rrs  rget_childrenzSymbolTable.get_childrens9++..0 DNN30	00s9N)r5r6r7r)rErPrSrUrXr[r^rarermrprirur8rrrr*sK
L=,
 "A(
*
*
H$
0rrcDeZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
y)rNcLtfdjDS)Nc3`K|]%}jj|r|'ywr#)r;rc).0ror(	test_funcs  r	<genexpr>z-Function.__idents_matching.<locals>.<genexpr>s/?u!$++"5"5e"<=?s+.)tuplere)r(rzs``r__idents_matchingzFunction.__idents_matchings%?(<(<(>??	?rc`|j|jd|_|jS)z6Return a tuple of parameters to the function.
        c|tzSr#)rxs r<lambda>z)Function.get_parameters.<locals>.<lambda>s
A	Mr)_Function__params_Function__idents_matchingr's rget_parameterszFunction.get_parameterss+==  223IJDM}}rc|j'ttffd}|j||_|jS)z2Return a tuple of locals in the function.
        c(|tz	tzvSr#rr)rlocss rrz%Function.get_locals.<locals>.<lambda>sqI~;Dr)_Function__localsrrr)r(testrs  @r
get_localszFunction.get_localss9== 4=DDD 2248DM}}rc|j'ttffd}|j||_|jS)z3Return a tuple of globals in the function.
        c(|tz	tzvSr#r)rglobs rrz&Function.get_globals.<locals>.<lambda>sa9n
:tCr)_Function__globalsrrr)r(rrs  @rget_globalszFunction.get_globalss:>>!#_5DCD!33D9DN~~rc`|j|jd|_|jS)z5Return a tuple of nonlocals in the function.
        c|tzSr#)rrs rrz(Function.get_nonlocals.<locals>.<lambda>sq<?Or)_Function__nonlocalsrr's r
get_nonlocalszFunction.get_nonlocalss0##556OPDrcd|jd}|j||_|jS)z:Return a tuple of free variables in the function.
        c0|tz	tztk(Sr#)rrr
rs rrz$Function.get_frees.<locals>.<lambda>si: =$Fr)_Function__freesr)r(is_frees  r	get_freeszFunction.get_freess/<<FG11':DL||r)r5r6r7rrrrrrrrrrrr8rrrrs;HHGIK? rrceZdZdZdZy)rNc|j<i}|jjD]}d||j<t	||_|jS)z9Return a tuple of methods declared in the class.
        )_Class__methodsr;r`rBr|)r(drrs   rget_methodszClass.get_methodssN>>!Akk**
"''

"1XDN~~r)r5r6r7rrr8rrrrsIrrcteZdZddddZdZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZdZdZy)rNFrgcn||_||_|tz	tz|_|xsd|_||_y)Nr8)
_Symbol__name_Symbol__flagsrr_Symbol__scope_Symbol__namespaces_Symbol__module_scope)r(rBrkrlrhs     rr)zSymbol.__init__s6*j8&,"*rc8dj|jS)Nz<symbol {0!r}>)rCrr's rrEzSymbol.__repr__s&&t{{33rc|jS)z#Return a name of a symbol.
        )rr's rrUzSymbol.get_names{{rcNt|jtjzS)zBReturn *True* if the symbol is used in
        its block.
        )rZrrrr's r
is_referencedzSymbol.is_referencedsDLL9==011rc:t|jtzS)z4Return *True* if the symbol is a parameter.
        )rZrrr's ris_parameterzSymbol.is_parameterDLL9,--rct|jttfvxs!|jxr|j
tzS)z/Return *True* if the symbol is global.
        )rZrrrrrr	r's r	is_globalzSymbol.is_globals@DLL_o$FFJ++Hy0HK	Krc:t|jtzS)z(Return *True* if the symbol is nonlocal.)rZrrr's ris_nonlocalzSymbol.is_nonlocalsDLL</00rc:t|jtk(S)zOReturn *True* if the symbol is declared global
        with a global statement.)rZrrr's ris_declared_globalzSymbol.is_declared_globalsDLLO344rct|jttfvxs!|jxr|j
tzS)z.Return *True* if the symbol is local.
        )rZrrrrrr	r's ris_localzSymbol.is_local
s?DLLUDM1J++Hy0HK	Krc:t|jtzS)z2Return *True* if the symbol is annotated.
        )rZrr
r's ris_annotatedzSymbol.is_annotatedrrc:t|jtk(S)zIReturn *True* if a referenced symbol is
        not assigned to.
        )rZrr
r's rrzSymbol.is_freesDLLD())rc:t|jtzS)zQReturn *True* if the symbol is created from
        an import statement.
        )rZrrr's ris_importedzSymbol.is_importedsDLL:-..rc:t|jtzS)z)Return *True* if a symbol is assigned to.)rZrrr's ris_assignedzSymbol.is_assigned$sDLL9,--rc,t|jS)aReturns *True* if name binding introduces new namespace.

        If the name is used as the target of a function or class
        statement, this will be true.

        Note that a single name can be bound to multiple objects.  If
        is_namespace() is true, the name may also be bound to other
        objects, like an int or list, that does not introduce a new
        namespace.
        )rZrr's ris_namespacezSymbol.is_namespace(sD%%&&rc|jS)z.Return a list of namespaces bound to this name)rr's rget_namespaceszSymbol.get_namespaces5s   rct|jdk(rtdt|jdkDrtd|jdS)zReturn the single namespace bound to this name.

        Raises ValueError if the name is bound to multiple namespaces
        or no namespace.
        rz#name is not bound to any namespacesrz$name is bound to multiple namespaces)lenr
ValueErrorr's r
get_namespacezSymbol.get_namespace9sSt  !Q&BCC
""
#a
'CDD$$Q''rr#)r5r6r7r)rErUrrrrrrrrrrrrrr8rrrrs[+U+4
2.
K15
K.
*/.'!(rr__main__rexec),__doc__rrrrrrrr	r
rrr
rrrrr$__all__rr!rrrrrr5ossysopenargvfreadsrcpathsplitmodrerorminfoprintrrr8rr<module>rs'844444
D*$%&p0p0f3{3lKb(b(Hz	
chhqk	affh
3

chhqk215v
>C$$&:zz% 
dDMMOT%6%6%89:sD++D4