fdoc

subroutineargument_tableprivate

subroutine argument_table(site, ids, components, b)

Write a table of dummy arguments, or with components of other variables, such as the components of a type. Those have no intent, and may have a default value and a permission.

Arguments

NameTypeIntentAttributesDescription
sitetype(site_t)in

the site

idsintegerindimension(:)

the variables

componentslogicalin

true for variables that are not arguments

btype(buffer_t)inout

the HTML

Calls

Source

Show the code
subroutine argument_table(site, ids, components, b)
    type(site_t), intent(in) :: site        !! the site
    integer, intent(in) :: ids(:)           !! the variables
    logical, intent(in) :: components       !! true for variables that are not arguments
    type(buffer_t), intent(inout) :: b      !! the HTML
    logical :: defaults
    integer :: k

    defaults = .false.
    if (components) then
        do k = 1, size(ids)
            if (allocated(site%p%list%box(ids(k))%e%initial)) defaults = .true.
        end do
    end if
    call add(b, '<table class="arguments">'//achar(10)//'<thead><tr><th>Name</th><th>Type</th>')
    if (.not. components) call add(b, '<th>Intent</th>')
    call add(b, '<th>Attributes</th>')
    if (defaults) call add(b, '<th>Default</th>')
    call add(b, '<th>Description</th></tr></thead>'//achar(10)//'<tbody>'//achar(10))
    do k = 1, size(ids)
        associate (e => site%p%list%box(ids(k))%e)
            call add(b, '<tr id="')
            call anchor(site, ids(k), b)
            call add(b, '"><td class="name">')
            call html_escape(e%name, b, .false.)
            call add(b, '</td><td class="type">')
            if (e%kind == E_VARIABLE) then
                call write_type(site, e, b)
                call add(b, '</td>')
                if (.not. components) then
                    call add(b, '<td>')
                    if (allocated(e%intent)) then
                        if (len(e%intent) > 0) call badge(e%intent, b)
                    end if
                    call add(b, '</td>')
                end if
                call add(b, '<td class="attributes">')
                if (components .and. allocated(e%permission)) then
                    if (e%permission /= 'public') call badge(e%permission, b)
                end if
                call argument_attributes(e, b)
                call add(b, '</td>')
                if (defaults) then
                    call add(b, '<td class="default">')
                    if (allocated(e%initial)) then
                        if (e%points) call add(b, '=&gt; ')
                        call html_escape(e%initial, b, .false.)
                    end if
                    call add(b, '</td>')
                end if
                call add(b, '<td>')
                if (allocated(e%html)) call add(b, e%html)
            else
                ! a dummy procedure with an interface
                call add(b, 'procedure</td><td></td><td class="attributes"></td><td>')
                if (allocated(e%summary)) call add(b, e%summary)
            end if
            call add(b, '</td></tr>'//achar(10))
        end associate
    end do
    call add(b, '</tbody>'//achar(10)//'</table>'//achar(10))
end subroutine argument_table

Graphs

Calls

Called by