Module Assign NameStore Str ImportFrom alias ImportFrom alias alias alias alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign NameStore BinOpMod Str AttributeLoad AttributeLoad NameLoad attr attr Return Call Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIs NameLoad NameLoad body Return If Call NameLoad NameLoad NameLoad body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr If CompareNotIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body If Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BoolOpAnd CompareIsNot Call NameLoad NameLoad Str NameLoad NameLoad Call NameLoad NameLoad Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Return Assign NameStore AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad While CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body If BoolOpAnd CompareIs Call AttributeLoad NameLoad attr NameLoad UnaryOpNot NameLoad body Return For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad decorator_list Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad NameLoad Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Return Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Return Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list
N/A N/A __author__ Ruslan Spivak <ruslan.spivak@gmail.com> slimit ast slimit.scope VarSymbol FuncSymbol LocalScope SymbolTable Visitor N/A object N/A visit N/A N/A self node N/A N/A N/A method N/A visit_%s N/A N/A node __class__ __name__ N/A N/A N/A getattr self method N/A self generic_visit node N/A generic_visit N/A N/A self node N/A N/A N/A N/A node None N/A N/A N/A N/A isinstance node list N/A N/A child node N/A N/A N/A N/A self visit child N/A N/A child N/A N/A node children N/A N/A N/A N/A self visit child N/A N/A ScopeTreeVisitor N/A Visitor N/A N/A Builds scope tree. __init__ N/A N/A self sym_table N/A N/A N/A N/A self sym_table sym_table N/A N/A self current_scope N/A sym_table globals N/A visit_VarDecl N/A N/A self node N/A N/A N/A ident N/A node identifier N/A symbol N/A VarSymbol name N/A ident value N/A N/A symbol N/A self current_scope N/A N/A N/A N/A N/A self current_scope define symbol N/A N/A ident scope N/A self current_scope N/A N/A N/A self visit N/A node initializer N/A visit_Identifier N/A N/A self node N/A N/A N/A N/A node scope N/A self current_scope N/A visit_FuncDecl N/A N/A self node N/A N/A N/A N/A N/A node identifier None N/A N/A name N/A N/A node identifier value N/A N/A N/A self visit_Identifier N/A node identifier N/A N/A name None N/A func_sym N/A FuncSymbol name name enclosing_scope N/A self current_scope N/A N/A name None N/A N/A N/A N/A N/A self current_scope define func_sym N/A N/A node scope N/A self current_scope N/A N/A self current_scope func_sym N/A ident N/A node parameters N/A N/A N/A N/A N/A self current_scope define N/A VarSymbol N/A ident value N/A N/A ident scope N/A self current_scope N/A element N/A node elements N/A N/A N/A N/A self visit element N/A N/A self current_scope N/A N/A N/A self current_scope get_enclosing_scope N/A N/A visit_FuncExpr visit_FuncDecl visit_Catch N/A N/A self node N/A N/A N/A ident N/A node identifier N/A existing_symbol N/A N/A N/A N/A self current_scope symbols get N/A ident value N/A N/A existing_symbol None N/A N/A N/A N/A N/A self current_scope define N/A VarSymbol N/A ident value N/A N/A ident scope N/A self current_scope N/A element N/A node elements N/A N/A N/A N/A self visit element N/A N/A RefVisitor N/A Visitor N/A N/A Fill 'ref' attribute in scopes. visit_Identifier N/A N/A self node N/A N/A N/A N/A N/A self _is_id_in_expr node N/A N/A N/A N/A self _fill_scope_refs N/A node value N/A node scope N/A _is_id_in_expr N/A N/A node N/A N/A N/A Return True if Identifier node is part of an expression. N/A N/A N/A N/A getattr node scope None None N/A getattr node _in_expression False N/A staticmethod _fill_scope_refs N/A N/A name scope N/A N/A N/A Put referenced name in 'ref' dictionary of a scope.

        Walks up the scope tree and adds the name to 'ref' of every scope
        up in the tree until a scope that defines referenced name is reached.
         N/A symbol N/A N/A scope resolve name N/A N/A symbol None N/A N/A N/A orig_scope N/A symbol scope N/A N/A N/A scope refs N/A name orig_scope N/A N/A scope orig_scope N/A N/A scope N/A N/A scope get_enclosing_scope N/A N/A N/A scope refs N/A name orig_scope N/A staticmethod N/A mangle_scope_tree N/A N/A root toplevel N/A N/A N/A Walk over a scope tree and mangle symbol names.

    Args:
        toplevel: Defines if global scope should be mangled or not.
     mangle N/A N/A scope N/A N/A N/A N/A N/A N/A N/A scope get_enclosing_scope None N/A toplevel N/A N/A N/A name N/A scope symbols N/A N/A mangled_name N/A N/A scope get_next_mangled_name N/A N/A N/A scope mangled N/A name mangled_name N/A N/A N/A scope rev_mangled N/A mangled_name name N/A visit N/A N/A node N/A N/A N/A N/A mangle node N/A child N/A node children N/A N/A N/A visit child N/A N/A N/A visit root N/A fill_scope_references N/A N/A tree N/A N/A N/A Fill 'ref' scope attribute with values. N/A visitor N/A RefVisitor N/A N/A N/A visitor visit tree N/A NameManglerVisitor N/A Visitor N/A N/A Mangles names.

    Walks over a parsed tree and changes ID values to corresponding
    mangled names.
     _is_mangle_candidate N/A N/A id_node N/A N/A N/A Return True if Identifier node is a candidate for mangling.

        There are 5 cases when Identifier is a mangling candidate:
        1. Function declaration identifier
        2. Function expression identifier
        3. Function declaration/expression parameter
        4. Variable declaration identifier
        5. Identifier is a part of an expression (primary_expr_no_brace rule)
         N/A N/A getattr id_node _mangle_candidate False N/A staticmethod visit_Identifier N/A N/A self node N/A N/A N/A Mangle names. N/A N/A N/A N/A self _is_mangle_candidate node N/A N/A N/A name N/A node value N/A symbol N/A N/A N/A node scope resolve N/A node value N/A N/A symbol None N/A N/A N/A mangled N/A N/A N/A N/A symbol scope mangled get name N/A N/A mangled None N/A N/A N/A node value mangled N/A N/A