(context, builder, sig, args, result)
Implementation of iternext() for the ArrayIterator type

    :param context: context descriptor
    :param builder: llvmlite IR Builder
    :param sig: iterator signature
    :param args: tuple with iterator arguments, such as instruction, operands and types
    :param result: iternext result
Implementation of iternext() for the ArrayIterator type
Implementation of iternext () for the ArrayIterator type
def iternext_series_array(context, builder, sig, args, result):
    """
    Implementation of iternext() for the ArrayIterator type

    :param context: context descriptor
    :param builder: llvmlite IR Builder
    :param sig: iterator signature
    :param args: tuple with iterator arguments, such as instruction, operands and types
    :param result: iternext result
    """

    [iterty] = sig.args
    [iter] = args
    arrayty = iterty.array_type

    if arrayty.ndim != 1:
        raise NotImplementedError("iterating over %dD array" % arrayty.ndim)

    iterobj = context.make_helper(builder, iterty, value=iter)
    ary = make_array(arrayty)(context, builder, value=iterobj.array)

    nitems, = cgutils.unpack_tuple(builder, ary.shape, count=1)

    index = builder.load(iterobj.index)
    is_valid = builder.icmp(lc.ICMP_SLT, index, nitems)
    result.set_valid(is_valid)

    with builder.if_then(is_valid):
        value = _getitem_array_single_int(
            context, builder, iterty.yield_type, arrayty, ary, index
        )
        result.yield_(value)
        nindex = cgutils.increment_index(builder, index)
        builder.store(nindex, iterobj.index)
def iternext_series_array ( context , builder , sig , args , result ) : [ iterty ] = sig . args [ iter ] = args arrayty = iterty . array_type if arrayty . ndim != 1 : raise NotImplementedError ( "iterating over %dD array" % arrayty . ndim ) iterobj = context . make_helper ( builder , iterty , value = iter ) ary = make_array ( arrayty ) ( context , builder , value = iterobj . array ) nitems , = cgutils . unpack_tuple ( builder , ary . shape , count = 1 ) index = builder . load ( iterobj . index ) is_valid = builder . icmp ( lc . ICMP_SLT , index , nitems ) result . set_valid ( is_valid ) with builder . if_then ( is_valid ) : value = _getitem_array_single_int ( context , builder , iterty . yield_type , arrayty , ary , index ) result . yield_ ( value ) nindex = cgutils . increment_index ( builder , index ) builder . store ( nindex , iterobj . index )