Exemple #1
0
 def copy_ref(self, new: RefExpr, original: RefExpr) -> None:
     new.kind = original.kind
     new.fullname = original.fullname
     target = original.node
     if isinstance(target, Var):
         target = self.visit_var(target)
     new.node = target
     new.is_def = original.is_def
Exemple #2
0
 def copy_ref(self, new: RefExpr, original: RefExpr) -> None:
     new.kind = original.kind
     new.fullname = original.fullname
     target = original.node
     if isinstance(target, Var):
         target = self.visit_var(target)
     new.node = target
     new.is_def = original.is_def
Exemple #3
0
 def copy_ref(self, new: RefExpr, original: RefExpr) -> None:
     new.kind = original.kind
     new.fullname = original.fullname
     target = original.node
     if isinstance(target, Var):
         target = self.visit_var(target)
     elif isinstance(target, FuncDef):
         # Use a placeholder node for the function if it exists.
         target = self.func_placeholder_map.get(target, target)
     new.node = target
     new.is_def = original.is_def
Exemple #4
0
 def copy_ref(self, new: RefExpr, original: RefExpr) -> None:
     new.kind = original.kind
     new.fullname = original.fullname
     target = original.node
     if isinstance(target, Var):
         # Do not transform references to global variables. See
         # testGenericFunctionAliasExpand for an example where this is important.
         if original.kind != GDEF:
             target = self.visit_var(target)
     elif isinstance(target, Decorator):
         target = self.visit_var(target.var)
     elif isinstance(target, FuncDef):
         # Use a placeholder node for the function if it exists.
         target = self.func_placeholder_map.get(target, target)
     new.node = target
     new.is_new_def = original.is_new_def
     new.is_inferred_def = original.is_inferred_def
Exemple #5
0
 def strip_ref_expr(self, node: RefExpr) -> None:
     node.kind = None
     node.node = None
     node.fullname = None
     node.is_new_def = False
     node.is_inferred_def = False
Exemple #6
0
 def visit_ref_expr(self, node: RefExpr) -> None:
     if node.node is not None:
         node.node = self.fixup(node.node)
         if isinstance(node.node, Var):
             # The Var node may be an orphan and won't otherwise be processed.
             fixup_var(node.node, self.replacements)
Exemple #7
0
 def strip_ref_expr(self, node: RefExpr) -> None:
     node.kind = None
     node.node = None
     node.fullname = None
Exemple #8
0
 def visit_ref_expr(self, node: RefExpr) -> None:
     node.node = self.fixup(node.node)
Exemple #9
0
 def strip_ref_expr(self, node: RefExpr) -> None:
     node.kind = None
     node.node = None
     node.fullname = None
     node.is_new_def = False
     node.is_inferred_def = False
Exemple #10
0
 def visit_ref_expr(self, node: RefExpr) -> None:
     if node.node is not None:
         node.node = self.fixup(node.node)
         if isinstance(node.node, Var):
             # The Var node may be an orphan and won't otherwise be processed.
             fixup_var(node.node, self.replacements)
Exemple #11
0
 def strip_ref_expr(self, node: RefExpr) -> None:
     node.kind = None
     node.node = None
     node.fullname = None
Exemple #12
0
 def visit_ref_expr(self, node: RefExpr) -> None:
     if node.node is not None:
         node.node = self.fixup(node.node)