functionselector_lengthpureprivate
pure integer function selector_length(text)
The length of the kind selector at the start of text, which is (...), *n or *(...).
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| text | character(len=*) | in | the text |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| selector_length | integer |
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