def translate_FunctionDef(self, ctx, tree):
argument_translation = ast.arguments(
args=[
ast.Name(id=arg.uniq_id)
for arg in tree.args.args
],
vararg=None,
kwarg=None,
defaults=[])
body_block = tree.body_block
body_block_translation = body_block.translate_return(ctx)
return ast.FunctionDef(
name=tree.uniq_id,
args=argument_translation,
body=body_block_translation,
decorator_list=[])
评论列表
文章目录