def __init__(self, parent: Node): self.scope = parent.scope self.target = self.scope.create_new_var(Type.generate_random_type()) self.type = self.target.get_type() super().__init__(parent) self.expression = generate_expression_node(self) self.scope.add_var(self.target)
def __init__(self, parent: Node): self.scope = parent.scope self.target = random.choice( self.collect_variables(Type.generate_random_type())) self.type = self.target.get_type() super().__init__(parent) self.type = self.target.get_type() self.expression = generate_expression_node(self)
def randomize_target(self): self.target = random.choice( self.collect_variables(Type.generate_random_type())) self.type = self.target.get_type() self.expression = generate_expression_node(self)