fdoc

subroutineclose_blockprivate

subroutine close_block(c, kind, word)

Leave a block, which must be of kind kind.

Arguments

NameTypeIntentAttributesDescription
ctype(fypp_t)inout

the state

kindintegerin

the kind

wordcharacter(len=*)in

the directive closing it

Calls

Source

Show the code
subroutine close_block(c, kind, word)
    type(fypp_t), intent(inout) :: c        !! the state
    integer, intent(in) :: kind             !! the kind
    character(len=*), intent(in) :: word    !! the directive closing it

    if (c%depth == 0) then
        call fail(c, word//' without a block to close')
    else if (c%nodes(c%stack(c%depth))%kind /= kind) then
        call fail(c, word//' does not match the block it closes')
    else
        c%depth = c%depth - 1
    end if
end subroutine close_block

Graphs

Calls

Called by