fdoc

functionleading_textpureprivate

pure character(len=80) function leading_text(v, j) result(text)

The first code tokens of v from token j, in lowercase and joined by blanks, up to about 80 characters.

Arguments

NameTypeIntentAttributesDescription
vtype(statement_view_t)in

the statement

jintegerin

the first token

Result

NameTypeAttributesDescription
textcharacter(len=80)private

Source

Show the code
pure function leading_text(v, j) result(text)
    type(statement_view_t), intent(in) :: v     !! the statement
    integer, intent(in) :: j                    !! the first token
    character(len=80) :: text
    integer :: k, n, w

    text = ''
    n = 0
    do k = j, v%n
        w = v%hi(k) - v%lo(k) + 1
        if (n + w >= len(text)) exit
        text(n + 1:n + w) = v%low(v%lo(k):v%hi(k))
        n = n + w + merge(1, 0, v%kind_of(k) == TK_NAME .and. v%kind_of(k + 1) == TK_NAME)
    end do
end function leading_text

Graphs

Called by