fdoc

subroutineoriginal_prefixprivate

subroutine original_prefix(line, low, n, attribs, text)

Set text to line(1:n) with the words of attribs removed, keeping the case of what is left.

Arguments

NameTypeIntentAttributesDescription
linecharacter(len=*)in

the statement

lowcharacter(len=*)in

the statement, in lowercase

nintegerin

the length of the prefix

attribstype(string_t)indimension(:)

the words to remove

textcharacter(len=:)outallocatable

the result

Source

Show the code
subroutine original_prefix(line, low, n, attribs, text)
    character(len=*), intent(in) :: line                !! the statement
    character(len=*), intent(in) :: low                 !! the statement, in lowercase
    integer, intent(in) :: n                            !! the length of the prefix
    type(string_t), intent(in) :: attribs(:)            !! the words to remove
    character(len=:), allocatable, intent(out) :: text  !! the result
    character(len=:), allocatable :: lowered
    integer :: k, at

    text = line(1:n)
    lowered = low(1:n)
    do k = 1, size(attribs)
        at = index(lowered, attribs(k)%s)
        if (at == 0) cycle
        text = text(:at - 1)//text(at + len(attribs(k)%s):)
        lowered = lowered(:at - 1)//lowered(at + len(attribs(k)%s):)
    end do
end subroutine original_prefix

Graphs

Called by