functioncontext_ofprivate
integer function context_of(p, item) result(context)
The type whose members a reference through item reaches, or 0.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| p | type(project_t) | in | the project | |
| item | integer | in | the entity, or 0 |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| context | integer |
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