function.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:sherlock.py 作者: Luavis 项目源码 文件源码
def generate_call(self, node, ext_info={}):
    if hasattr(node, 'kwargs'):
        if not node.kwargs is None:
            raise SyntaxNotSupportError('Keyword arguments is not support yet.')
    elif not len(node.keywords) == 0:
        raise SyntaxNotSupportError('Keyword arguments is not support yet.')
    function_name = node.func.id
    if len(node.args) is 0:
        return '%s' % function_name
    argument_list = []
    if is_system_function(function_name):
        return self.generate_system_function(node, ext_info)
    for x in node.args:
        if isinstance(x, ast.Call):
            new_temp_variable = self.temp_variable.get_new_name()
            self.code_buffer.append(self.dispatch(x))
            self.code_buffer.append('%s=$__return_%s' % (new_temp_variable, x.func.id))
            argument_list.append(new_temp_variable)
        else:
            ext_info['is_arg'] = True
            argument_list.append(self.dispatch(x, ext_info=ext_info))
    arguments_code = ' '.join(argument_list)
    return '%s %s' % (function_name, arguments_code)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号