functionis_type_declaration
logical function is_type_declaration(low)
True if low starts a type declaration rather than, for example, an assignment.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| low | character(len=*) | in | the statement, in lowercase |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| is_type_declaration | logical |
Calls
Source
Show the code
logical function is_type_declaration(low)
character(len=*), intent(in) :: low !! the statement, in lowercase
character(len=:), allocatable :: word
integer :: n, next
character :: c
call type_keyword(low, n, word)
is_type_declaration = n > 0
if (n == 0 .or. n >= len(low)) return
next = n + verify(low(n + 1:)//'x', ' ')
c = low(n + 1:n + 1)
if (index('abcdefghijklmnopqrstuvwxyz0123456789_', c) > 0) then
is_type_declaration = .false.
return
end if
if (next > len(low)) return
if (low(next:next) == '=' .or. low(next:next) == '%') is_type_declaration = .false.
end function is_type_declaration