예제 #1
0
파일: finder.py 프로젝트: numerodix/delpy
 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])
예제 #2
0
def output_code(tree):
    code = unparser.unparse(tree)
    io.output(code)
예제 #3
0
def write_file(filepath, tree):
    code = unparser.unparse(tree)
    open(filepath, 'w').write(code)
예제 #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)