fdoc

subroutinename_and_entityprivate

subroutine name_and_entity(text, name, entity)

Split name(entity).

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)in

the text

namecharacter(len=:)outallocatable

the name

entitycharacter(len=:)outallocatable

the entity type, or ''

Source

Show the code
subroutine name_and_entity(text, name, entity)
    character(len=*), intent(in) :: text                    !! the text
    character(len=:), allocatable, intent(out) :: name      !! the name
    character(len=:), allocatable, intent(out) :: entity    !! the entity type, or `''`
    integer :: open

    open = index(text, '(')
    if (open > 0) then
        name = text(:open - 1)
        entity = text(open + 1:len(text) - 1)
    else
        name = text
        entity = ''
    end if
end subroutine name_and_entity

Graphs

Called by