Kind of a preprocessor line (lowercase text) as a fypp block directive: one of the FY_* constants.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
text of the preprocessor token, in lowercase |
pure integer function fypp_kind(text) result(kind) !! Kind of a preprocessor line (lowercase text) as a fypp block directive: one of the FY_* !! constants. character(len=*), intent(in) :: text !! text of the preprocessor token, in lowercase integer :: i, j kind = FY_OTHER if (len(text) < 3) return if (text(1:2) /= '#:') return i = 3 do while (i <= len(text)) if (text(i:i) /= ' ' .and. text(i:i) /= achar(9)) exit i = i + 1 end do j = i do while (j <= len(text)) if (text(j:j) < 'a' .or. text(j:j) > 'z') exit j = j + 1 end do select case (text(i:j - 1)) case ('if', 'for', 'def', 'block', 'call', 'mute') kind = FY_OPEN case ('elif', 'else', 'nextarg') kind = FY_MIDDLE case ('endif', 'endfor', 'enddef', 'endblock', 'endcall', 'endmute') kind = FY_CLOSE end select end function fypp_kind