Exemplo n.º 1
0
 def visit_member_expr(self, node: MemberExpr) -> Node:
     member = MemberExpr(self.node(node.expr),
                         node.name)
     if node.def_var:
         member.def_var = self.visit_var(node.def_var)
     self.copy_ref(member, node)
     return member
Exemplo n.º 2
0
 def visit_member_expr(self, node: MemberExpr) -> Node:
     member = MemberExpr(self.node(node.expr),
                         node.name)
     if node.def_var:
         member.def_var = self.visit_var(node.def_var)
     self.copy_ref(member, node)
     return member
Exemplo n.º 3
0
 def visit_member_expr(self, node: MemberExpr) -> MemberExpr:
     member = MemberExpr(self.expr(node.expr), node.name)
     if node.def_var:
         # This refers to an attribute and we don't transform attributes by default,
         # just normal variables.
         member.def_var = node.def_var
     self.copy_ref(member, node)
     return member
Exemplo n.º 4
0
 def visit_member_expr(self, node: MemberExpr) -> MemberExpr:
     member = MemberExpr(self.expr(node.expr),
                         node.name)
     if node.def_var:
         # This refers to an attribute and we don't transform attributes by default,
         # just normal variables.
         member.def_var = node.def_var
     self.copy_ref(member, node)
     return member
Exemplo n.º 5
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     self.strip_ref_expr(node)
     if self.is_duplicate_attribute_def(node):
         # This is marked as a instance variable definition but a base class
         # defines an attribute with the same name, and we can't have
         # multiple definitions for an attribute. Defer to the base class
         # definition.
         del self.type.names[node.name]
         node.is_def = False
         node.def_var = None
Exemplo n.º 6
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     self.strip_ref_expr(node)
     if self.is_duplicate_attribute_def(node):
         # This is marked as an instance variable definition but a base class
         # defines an attribute with the same name, and we can't have
         # multiple definitions for an attribute. Defer to the base class
         # definition.
         if self.type is not None:
             del self.type.names[node.name]
         node.is_inferred_def = False
         node.def_var = None
     super().visit_member_expr(node)
Exemplo n.º 7
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     self.strip_ref_expr(node)
     # These need to cleared for member expressions but not for other RefExprs since
     # these can change based on changed in a base class.
     node.is_new_def = False
     node.is_inferred_def = False
     if self.is_duplicate_attribute_def(node):
         # This is marked as an instance variable definition but a base class
         # defines an attribute with the same name, and we can't have
         # multiple definitions for an attribute. Defer to the base class
         # definition.
         self.strip_class_attr(node.name)
         node.def_var = None
     super().visit_member_expr(node)
Exemplo n.º 8
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     self.strip_ref_expr(node)
     # These need to cleared for member expressions but not for other RefExprs since
     # these can change based on changed in a base class.
     node.is_new_def = False
     node.is_inferred_def = False
     if self.is_duplicate_attribute_def(node):
         # This is marked as an instance variable definition but a base class
         # defines an attribute with the same name, and we can't have
         # multiple definitions for an attribute. Defer to the base class
         # definition.
         self.strip_class_attr(node.name)
         node.def_var = None
     if isinstance(node.node, Var):
         self._reset_var_final_flags(node.node)
     super().visit_member_expr(node)
Exemplo n.º 9
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     if node.def_var:
         node.def_var = self.fixup(node.def_var)
     self.visit_ref_expr(node)
     super().visit_member_expr(node)
Exemplo n.º 10
0
 def visit_member_expr(self, node: MemberExpr) -> None:
     if node.def_var:
         node.def_var = self.fixup(node.def_var)
     self.visit_ref_expr(node)
     super().visit_member_expr(node)