Comment sub-kind (one of the CM_* constants) of a comment.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
comment text, from |
integer function comment_kind(text) result(kind) !! Comment sub-kind (one of the CM_* constants) of a comment. character(len=*), intent(in) :: text !! comment text, from `!` to the end of the line character(len=:), allocatable :: low character(len=*), parameter :: prefixes(*) = [character(len=6) :: & '!dir$', '!dec$', '!gcc$', '!ibm*', '!cdir$', '!pgi$', '!ms$', '!nec$'] integer :: k kind = CM_PLAIN low = lowercase(text) if (len(low) >= 2) then select case (low(2:2)) case ('$') if (is_letter(peek(low, 3))) then kind = CM_DIRECTIVE else kind = CM_CONDITIONAL end if return case ('&') kind = CM_FORMATTER return end select end if do k = 1, size(prefixes) if (index(low, trim(prefixes(k))) == 1) then kind = CM_DIRECTIVE return end if end do end function comment_kind