fdoc

functionis_setextpureprivate

pure logical function is_setext(block)

True if the second line of block underlines the first.

Arguments

NameTypeIntentAttributesDescription
blockcharacter(len=*)in

the chunk

Result

NameTypeAttributesDescription
is_setextlogical

Calls

Source

Show the code
pure logical function is_setext(block)
    character(len=*), intent(in) :: block   !! the chunk
    integer :: a, b
    character :: c

    is_setext = .false.
    a = index(block, NL)
    if (a == 0 .or. a == len(block)) return
    b = index(block(a + 1:), NL)
    b = merge(len(block), a + b - 1, b == 0)
    c = block(a + 1:a + 1)
    if (c /= '=' .and. c /= '-') return
    is_setext = verify(block(a + 1:b), c//' ') == 0 .and. verify(strip(block(a + 1:b)), c) == 0
end function is_setext

Graphs

Calls

Called by