def generateListOperationAppendCode(statement, emit, context):
    list_arg_name = context.allocateTempName('append_list')
    generateExpressionCode(to_name=list_arg_name, expression=statement.getList(), emit=emit, context=context)
    value_arg_name = context.allocateTempName('append_value')
    generateExpressionCode(to_name=value_arg_name, expression=statement.getValue(), emit=emit, context=context)
    context.setCurrentSourceCodeReference(statement.getSourceReference())
    res_name = context.getIntResName()
    emit(('assert( PyList_Check( %s ) );' % list_arg_name))
    emit(('%s = PyList_Append( %s, %s );' % (res_name, list_arg_name, value_arg_name)))
    getReleaseCodes(release_names=(list_arg_name, value_arg_name), emit=emit, context=context)
    getErrorExitBoolCode(condition=('%s == -1' % res_name), emit=emit, context=context)
def generateListOperationAppendCode(statement, emit, context):
    list_arg_name = context.allocateTempName('append_list')
    generateExpressionCode(to_name=list_arg_name, expression=statement.getList(), emit=emit, context=context)
    value_arg_name = context.allocateTempName('append_value')
    generateExpressionCode(to_name=value_arg_name, expression=statement.getValue(), emit=emit, context=context)
    context.setCurrentSourceCodeReference(statement.getSourceReference())
    res_name = context.getIntResName()
    emit(('assert( PyList_Check( %s ) );' % list_arg_name))
    emit(('%s = PyList_Append( %s, %s );' % (res_name, list_arg_name, value_arg_name)))
    getReleaseCodes(release_names=(list_arg_name, value_arg_name), emit=emit, context=context)
    getErrorExitBoolCode(condition=('%s == -1' % res_name), emit=emit, context=context)