fdoc

functionis_executableprivate

logical function is_executable(v, info, source_low)

True if statement v can have procedure references: not a declaration.

Arguments

NameTypeIntentAttributesDescription
vtype(statement_view_t)in

the statement

infotype(stmt_info_t)in

its classification

source_lowcharacter(len=*)in

its first words, in lowercase

Result

NameTypeAttributesDescription
is_executablelogical

Calls

Source

Show the code
logical function is_executable(v, info, source_low)
    type(statement_view_t), intent(in) :: v     !! the statement
    type(stmt_info_t), intent(in) :: info       !! its classification
    character(len=*), intent(in) :: source_low  !! its first words, in lowercase

    is_executable = .false.
    select case (info%role)
    case (ROLE_CLOSE)
        return
    case (ROLE_OPEN)
        select case (info%construct)
        case (C_IF, C_DO, C_SELECT, C_ASSOCIATE, C_WHERE, C_FORALL)
            is_executable = .true.
        end select
        return
    case (ROLE_MIDDLE)
        is_executable = info%construct /= C_CONTAINS
        return
    end select
    if (v%n == 0) return
    if (is_type_declaration(source_low) .or. is_attribute_statement(source_low)) return
    if (starts_word(source_low, 'use') .or. starts_word(source_low, 'implicit') .or. &
        starts_word(source_low, 'import') .or. starts_word(source_low, 'namelist') .or. &
        starts_word(source_low, 'common') .or. starts_word(source_low, 'format') .or. &
        starts_word(source_low, 'equivalence') .or. starts_word(source_low, 'module')) return
    if (starts_word(source_low, 'goto') .or. starts_word(source_low, 'go')) then
        is_executable = index(source_low, '(') == 0
        return
    end if
    is_executable = .true.
end function is_executable

Graphs

Calls

Called by