fdoc

functionselector_lengthpureprivate

pure integer function selector_length(text)

The length of the kind selector at the start of text, which is (...), *n or *(...).

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)in

the text

Result

NameTypeAttributesDescription
selector_lengthinteger

Calls

Source

Show the code
pure integer function selector_length(text)
    character(len=*), intent(in) :: text    !! the text
    integer :: k

    selector_length = 0
    if (len(text) == 0) return
    if (text(1:1) == '(') then
        selector_length = closing_paren(text, 1)
    else if (text(1:1) == '*') then
        k = 1 + verify(text(2:)//'x', ' ')
        if (k > len(text)) return
        if (text(k:k) == '(') then
            selector_length = closing_paren(text, k)
        else
            selector_length = k + verify(text(k:)//'x', '0123456789') - 2
        end if
    end if
end function selector_length

Graphs

Calls

Called by