subroutineapply_attributesprivate
subroutine apply_attributes(list, id)
Apply statements such as public :: x to the entities they name.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | type(entity_list_t) | inout | the entities | |
| id | integer | in | the unit |
Calls
Source
Show the code
subroutine apply_attributes(list, id)
type(entity_list_t), intent(inout) :: list !! the entities
integer, intent(in) :: id !! the unit
character(len=:), allocatable :: name
integer :: c, k, child
associate (u => list%box(id)%e)
do c = 1, size(u%children)
child = u%children(c)
associate (e => list%box(child)%e)
select case (e%kind)
case (E_FUNCTION, E_SUBROUTINE, E_TYPE, E_INTERFACE, E_VARIABLE)
if (.not. allocated(e%name)) cycle
name = lowercase(e%name)
do k = 1, size(u%more%pending)
if (u%more%pending(k)%name == name) then
call apply_one(e, u, u%more%pending(k)%value)
u%more%pending(k)%name = ''
end if
end do
if (allocated(e%permission)) then
if (e%permission == 'public') call push(u%more%public_list, name)
end if
end select
end associate
end do
do k = 1, size(u%more%pending)
if (u%more%pending(k)%value == 'public' .and. len(u%more%pending(k)%name) > 0) then
call push(u%more%public_list, u%more%pending(k)%name)
end if
end do
do c = 1, size(u%children)
child = u%children(c)
if (list%box(child)%e%kind /= E_VARIABLE) cycle
if (contains_string(list%box(child)%e%attribs, 'external')) list%box(child)%e%var_role = VAR_HIDDEN
end do
call mark_common_members(list, id)
end associate
end subroutine apply_attributes