functionis_attribute_statementprivate
logical function is_attribute_statement(low)
True if low starts with a word that gives attributes to names listed after it.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| low | character(len=*) | in | the statement, in lowercase |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| is_attribute_statement | logical |
Calls
Source
Show the code
logical function is_attribute_statement(low)
character(len=*), intent(in) :: low !! the statement, in lowercase
character(len=:), allocatable :: compact
integer :: k, n
is_attribute_statement = .false.
if (starts_word(low, 'bind')) then
is_attribute_statement = index(low, ')') > 0
return
end if
if (starts_word(low, 'intent')) then
is_attribute_statement = .true.
return
end if
do k = 1, size(ATTRIBUTE_WORDS)
if (.not. starts_word(low, trim(ATTRIBUTE_WORDS(k)))) cycle
n = len_trim(ATTRIBUTE_WORDS(k))
compact = strip(low(n + 1:))
if (len(compact) == 0) then
is_attribute_statement = trim(ATTRIBUTE_WORDS(k)) == 'save'
return
end if
! not an assignment to a variable named like the attribute
is_attribute_statement = compact(1:1) /= '=' .and. compact(1:1) /= '%'
return
end do
end function is_attribute_statement