fdoc

functioncontext_ofprivate

integer function context_of(p, item) result(context)

The type whose members a reference through item reaches, or 0.

Arguments

NameTypeIntentAttributesDescription
ptype(project_t)in

the project

itemintegerin

the entity, or 0

Result

NameTypeAttributesDescription
contextinteger

Calls

Source

Show the code
integer function context_of(p, item) result(context)
    type(project_t), intent(in) :: p    !! the project
    integer, intent(in) :: item         !! the entity, or 0
    integer :: var

    context = 0
    if (item == 0) return
    select case (p%list%box(item)%e%kind)
    case (E_FUNCTION)
        var = p%list%box(item)%e%result
        if (var > 0) context = variable_type(p, var)
    case (E_TYPE)
        context = item
    case (E_VARIABLE)
        context = variable_type(p, item)
    end select
end function context_of

Graphs

Calls

Called by