subroutineclose_blockprivate
subroutine close_block(c, kind, word)
Leave a block, which must be of kind kind.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| c | type(fypp_t) | inout | the state | |
| kind | integer | in | the kind | |
| word | character(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