def visit_Constant(self, node): type = self.type_env[node.type] const = types.convert(node.value, types.resolve_typedef(type)) if isinstance(const, basestring): const = const[1:-1] # slice away quotes return Const(const)
def convert(self, arg): return types.convert(arg, self.op.type)
def convert_args(self, args): return [types.convert(arg, argtype) for arg, argtype in zip(args, self.f.type.argtypes)]
def visit_Constant(self, node): type = self.type_env[node.type] const = types.convert(node.value, type) return Const(const)