def get_func_sig_s(self, node): path = [ Many, ProcedureSignature, ] sigs = self.get(node, path) if sigs: sig = sigs[0] cls, kw, id, params, typespec = sig.children name = self.get_func_name(node) params = unparser.unparse(params) type = unparser.unparse(typespec) return "".join([name, params, type])
def output_code(tree): code = unparser.unparse(tree) io.output(code)
def write_file(filepath, tree): code = unparser.unparse(tree) open(filepath, 'w').write(code)
def format_stm_to_comment(self, node): if type(node) != StatementSemi: node = self.mk_statement_semi(node) stm_s = unparser.unparse(node) comm_s = "{ REMOTED:\n %s\n}" % stm_s return self.mk_commentlist(comm_s)