subroutineprocedure_badgesprivate
subroutine procedure_badges(e, b)
Write the attributes of procedure e that say how it behaves, as badges. Anything else is left out.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| e | type(entity_t) | in | the entity | |
| b | type(buffer_t) | inout | the HTML |
Calls
Source
Show the code
subroutine procedure_badges(e, b)
type(entity_t), intent(in) :: e !! the entity
type(buffer_t), intent(inout) :: b !! the HTML
integer :: k
if (.not. is_procedure(e%kind)) return
if (allocated(e%attribs)) then
do k = 1, size(e%attribs)
select case (lowercase(e%attribs(k)%s))
case ('pure')
call explained_badge('pure', 'Has no side effects', b)
case ('impure')
call explained_badge('impure', 'May have side effects', b)
case ('elemental')
call explained_badge('elemental', 'Works on each element of arrays of any rank', b)
case ('recursive')
call explained_badge('recursive', 'May call itself', b)
case ('non_recursive')
call explained_badge('non_recursive', 'Must not call itself', b)
end select
end do
end if
if (allocated(e%more%bind_c)) call explained_badge('bind(C)', 'Can be called from C', b)
if (e%more%saved_state) then
call explained_badge('saved state', 'Keeps values between calls, so calls from several threads at once may conflict', b)
end if
if (e%more%common_block) then
call explained_badge('common', 'Uses a common block, so calls from several threads at once may conflict', b)
end if
end subroutine procedure_badges