Exemple #1
0
 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])
Exemple #2
0
def output_code(tree):
    code = unparser.unparse(tree)
    io.output(code)
Exemple #3
0
def write_file(filepath, tree):
    code = unparser.unparse(tree)
    open(filepath, 'w').write(code)
Exemple #4
0
 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)