fdoc

subroutinetag_atpureprivate

pure subroutine tag_at(line, at, tag)

The tag at position at of line, in lowercase, or ''.

Arguments

NameTypeIntentAttributesDescription
linecharacter(len=*)in

the line

atintegerin

the position of <

tagcharacter(len=:)outallocatable

the tag

Source

Show the code
pure subroutine tag_at(line, at, tag)
    character(len=*), intent(in) :: line                !! the line
    integer, intent(in) :: at                           !! the position of `<`
    character(len=:), allocatable, intent(out) :: tag   !! the tag
    integer :: n

    tag = ''
    if (at + 1 > len(line)) return
    n = verify(line(at + 1:)//' ', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
    if (n > 1) tag = lowercase(line(at + 1:at + n - 1))
end subroutine tag_at

Graphs

Called by