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)
评论列表
文章目录