subroutinerecord_spanprivate
subroutine record_span(c, first, last)
Record that the output from after first to last was evaluated.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| c | type(fypp_t) | inout | the state | |
| first | integer | in | the position before it | |
| last | integer | in | 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