fdoc

subroutinerecord_spanprivate

subroutine record_span(c, first, last)

Record that the output from after first to last was evaluated.

Arguments

NameTypeIntentAttributesDescription
ctype(fypp_t)inout

the state

firstintegerin

the position before it

lastintegerin

its last position

Source

Show the code
subroutine record_span(c, first, last)
    type(fypp_t), intent(inout) :: c    !! the state
    integer, intent(in) :: first        !! the position before it
    integer, intent(in) :: last         !! its last position
    type(span_t), allocatable :: grown(:)

    if (c%num_spans == size(c%spans)) then
        allocate (grown(2*c%num_spans))
        grown(1:c%num_spans) = c%spans(1:c%num_spans)
        call move_alloc(grown, c%spans)
    end if
    c%num_spans = c%num_spans + 1
    c%spans(c%num_spans) = span_t(first, last)
end subroutine record_span

Graphs

Called by