subroutineindex_entity_names
subroutine index_entity_names(list)
Index the entities that links can name from anywhere, for find_anywhere.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | type(entity_list_t) | inout | the entities |
Calls
Source
Show the code
subroutine index_entity_names(list)
type(entity_list_t), intent(inout) :: list !! the entities
integer, allocatable :: last(:)
integer :: k, first, at
allocate (list%next_named(list%n), last(list%n))
list%next_named = 0
do k = 1, list%n
associate (e => list%box(k)%e)
if (.not. top_level(e%kind) .or. .not. allocated(e%name)) cycle
at = merge(last_separator(e%name), 0, e%kind == E_FILE)
first = index_find(list%names, lowercase(e%name(at + 1:)))
if (first == 0) then
call index_set(list%names, lowercase(e%name(at + 1:)), k)
last(k) = k
else
list%next_named(last(first)) = k
last(first) = k
end if
end associate
end do
end subroutine index_entity_names