The construct that end second third closes (C_ANY for a bare end), or C_NONE if
second names no construct, so that the end is not a closing statement.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | second |
the word after |
||
| character(len=*), | intent(in) | :: | third |
the word after that, or |
pure integer function closed_construct(second, third) result(construct) !! The construct that `end second third` closes (`C_ANY` for a bare `end`), or `C_NONE` if !! `second` names no construct, so that the `end` is not a closing statement. character(len=*), intent(in) :: second !! the word after `end`, in lowercase, or `''` character(len=*), intent(in) :: third !! the word after that, or `''` (`data` in `end block data`) select case (second) case ('') construct = C_ANY case ('if') construct = C_IF case ('do') construct = C_DO case ('select') construct = C_SELECT case ('associate') construct = C_ASSOCIATE case ('block') construct = merge(C_BLOCK_DATA, C_BLOCK, third == 'data') case ('blockdata') construct = C_BLOCK_DATA case ('critical') construct = C_CRITICAL case ('team') construct = C_TEAM case ('where') construct = C_WHERE case ('forall') construct = C_FORALL case ('enum') construct = C_ENUM case ('enumeration') construct = merge(C_ENUMERATION, C_NONE, third == 'type') case ('interface') construct = C_INTERFACE case ('type') construct = C_TYPE case ('function') construct = C_FUNCTION case ('subroutine') construct = C_SUBROUTINE case ('procedure') construct = C_PROCEDURE case ('module') construct = C_MODULE case ('submodule') construct = C_SUBMODULE case ('program') construct = C_PROGRAM case default construct = C_NONE end select end function closed_construct