def visit_define_values(self, ast, vars, env_structure): assert isinstance(ast, DefineValues) need_cell_flags = [ModuleVar(i, None, i) in vars for i in ast.names] rhs = ast.rhs.visit(self, vars, env_structure) if True in need_cell_flags: rhs = Cell(rhs, need_cell_flags) return DefineValues(ast.names, rhs, ast.display_names)
def make_symbols(d): v = variable_set() for i, j in d.iteritems(): v[ModuleVar(W_Symbol.make(i), None, W_Symbol.make(i))] = j return v
def visit_module_var(self, ast): assert isinstance(ast, ModuleVar) var = ModuleVar(ast.sym, ast.srcmod, ast.srcsym, ast.path) var.modenv = ast.modenv var.w_value = ast.w_value return var